/* ═══════════════════════════════════════════════
   AI LABS Design System v3
   Minimalist · Dark-first · Linear/Vercel-inspired
   ═══════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --bg: #ffffff;
  --bg-surface: #f4f4f5;
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --text-1: #09090b;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-subtle: rgba(59, 130, 246, 0.08);
  --accent-text: #3b82f6;
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-img: 8px;
  --nav-h: 64px;
}

html.dark {
  --bg: #09090b;
  --bg-surface: #18181b;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text-1: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent-text: #60a5fa;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { height: 32px; width: auto; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: color 150ms ease;
}
.nav-link:hover { color: var(--text-1); }
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2);
  transition: border-color 150ms ease, color 150ms ease;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--text-1); }
.theme-toggle svg { width: 18px; height: 18px; }
.nav-icon {
  display: flex; align-items: center; color: var(--text-2);
  transition: color 150ms ease;
}
.nav-icon:hover { color: var(--text-1); }
.nav-icon svg { width: 20px; height: 20px; }

/* ── Hero ── */
.hero {
  padding: calc(var(--nav-h) + 80px) 1.5rem 80px;
  text-align: center;
}
.hero-inner { max-width: 600px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.15;
  margin-bottom: 1rem;
}
.hero .subtitle {
  font-size: 1.125rem; color: var(--text-2);
  line-height: 1.7; margin-bottom: 2.5rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 500;
  padding: 10px 20px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text-1);
  transition: border-color 150ms ease, background 150ms ease;
}
.btn:hover { border-color: var(--border-hover); }
.btn svg { width: 16px; height: 16px; }
.btn-accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-accent:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
}

/* ── Sections ── */
.section { padding: 80px 1.5rem; }
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-label {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 1.5rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 2.5rem;
}

/* ── App Card Grid ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.app-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 200ms ease;
}
.app-card:hover { border-color: var(--border-hover); }
.app-card-image {
  aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-img);
  margin: 0.75rem 0.75rem 0;
}
.app-card-image img { width: 100%; height: 100%; object-fit: cover; }
.app-card-body {
  padding: 1rem 1rem 1.25rem;
  display: flex; flex-direction: column; flex: 1;
}
.app-card-body h3 {
  font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.375rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.badge-new {
  display: inline-block; font-size: 0.6875rem; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
  background: var(--accent-subtle); color: var(--accent-text);
}
.app-card-body p {
  font-size: 0.8125rem; color: var(--text-2); line-height: 1.6;
  margin-bottom: 1rem; flex: 1;
}
.app-card-body .btn {
  align-self: flex-start; margin-top: auto;
  font-size: 0.8125rem; padding: 7px 14px;
}
.app-card-body .btn-row {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto;
}
.app-card-body .btn-row .btn { margin-top: 0; }

/* ── Capabilities ── */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.cap { padding: 1.5rem; }
.cap-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; background: var(--accent-subtle); color: var(--accent);
}
.cap-icon svg { width: 20px; height: 20px; }
.cap h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.5rem; }
.cap p { font-size: 0.8125rem; color: var(--text-2); line-height: 1.6; }

/* ── Category Labels ── */
.cat-label {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3);
  margin: 2.5rem 0 1rem;
}
.cat-label:first-child { margin-top: 0; }

/* ── Footer ── */
.footer { padding: 2rem 1.5rem; border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer p { font-size: 0.8125rem; color: var(--text-3); }
.footer-links { display: flex; align-items: center; gap: 1rem; }
.footer a { color: var(--text-2); transition: color 150ms ease; }
.footer a:hover { color: var(--text-1); }

/* ── Page Content (appscript, privacy) ── */
.page-wrap {
  max-width: 800px; margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 1.5rem 80px;
}
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 0.5rem;
}
.page-header p { font-size: 0.875rem; color: var(--text-3); }
.page-content {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 2.5rem;
}
.page-content h2 {
  font-size: 1.125rem; font-weight: 600;
  margin-bottom: 0.75rem; color: var(--text-1);
}
.page-content p,
.page-content li {
  font-size: 0.9375rem; color: var(--text-2); line-height: 1.7;
}
.page-content a { color: var(--accent); }
.page-content a:hover { text-decoration: underline; }
.page-content section { padding: 0; margin-bottom: 2rem; }
.page-content section:last-child { margin-bottom: 0; }
.page-content ol,
.page-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content li { margin-bottom: 0.5rem; }
.note-box {
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
}
.note-box p { color: var(--text-1) !important; font-size: 0.875rem !important; }
.page-content pre {
  background: #09090b; border: 1px solid #27272a;
  border-radius: var(--radius-btn); padding: 1.5rem;
  overflow-x: auto; margin-bottom: 1rem; position: relative;
}
.page-content code {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.8125rem; line-height: 1.6; color: #e4e4e7;
}
.copy-btn {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #a1a1aa; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 150ms ease;
}
.copy-btn:hover { background: rgba(255,255,255,0.14); }
.copy-btn svg { width: 16px; height: 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { padding: calc(var(--nav-h) + 48px) 1.5rem 48px; }
  .hero h1 { font-size: 2rem; }
  .cap-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
  .nav-right .nav-link-text { display: none; }
  .section { padding: 48px 1rem; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .hero .subtitle { font-size: 1rem; }
}
