/* =============================================================
   BlackData AI — global stylesheet
   Design tokens, layout primitives, and reusable components.
   Used by every page. Edit tokens in :root to re-skin the site.
   ============================================================= */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---- Design tokens ---- */
:root {
  /* base / surfaces */
  --bg:        #07080a;
  --bg-2:      #0b0d11;
  --surface:   #101319;
  --surface-2: #14181f;
  --elevated:  #171c24;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.12);

  /* text */
  --text:      #f4f5f7;
  --text-2:    #a3a9b4;
  --text-3:    #6c727d;

  /* accents */
  --blue:        #3d7bff;
  --blue-bright: #5b93ff;
  --blue-dim:    rgba(61,123,255,0.14);
  --blue-glow:   rgba(61,123,255,0.35);
  --green:       #23c08a;
  --green-dim:   rgba(35,192,138,0.14);

  /* type */
  --font-display: 'Sora', sans-serif;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* layout */
  --maxw: 1200px;
  --maxw-narrow: 820px;
  --nav-h: 68px;
  --radius:   18px;
  --radius-sm: 11px;
  --radius-lg: 24px;

  --shadow:    0 18px 50px -22px rgba(0,0,0,0.7);
  --shadow-sm: 0 8px 24px -14px rgba(0,0,0,0.65);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
h4 { font-size: 1.08rem; letter-spacing: -0.01em; }
p { color: var(--text-2); text-wrap: pretty; }
strong { color: var(--text); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-bright);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 10px var(--blue-glow);
}
.eyebrow.green { color: var(--green); }
.eyebrow.green::before { background: var(--green); box-shadow: 0 0 10px var(--green-dim); }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); line-height: 1.6; }
.muted { color: var(--text-3); }
.text-green { color: var(--green); }
.text-blue  { color: var(--blue-bright); }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--maxw-narrow); }
section { position: relative; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.tight { padding: clamp(48px, 6vw, 80px) 0; }
.center { text-align: center; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head p { margin-top: 16px; font-size: 1.08rem; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.divider { height: 1px; background: var(--line); border: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  padding: 0.85em 1.5em; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 10px 28px -10px var(--blue-glow);
}
.btn-primary:hover { background: var(--blue-bright); box-shadow: 0 14px 34px -8px var(--blue-glow); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); }
.btn-soft { background: var(--blue-dim); color: var(--blue-bright); border-color: rgba(61,123,255,0.25); }
.btn-soft:hover { background: rgba(61,123,255,0.2); }
.btn-block { width: 100%; }
.btn-lg { padding: 1em 1.8em; font-size: 1.02rem; }
.btn-sm { padding: 0.6em 1.05em; font-size: 0.85rem; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---- Cards ---- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card.hover:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.card-pad-lg { padding: 34px; }

/* feature / value tiles */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: border-color .25s, transform .25s; }
.tile.hover:hover { border-color: var(--line-2); transform: translateY(-3px); }
.tile h4 { margin-bottom: 8px; }
.tile p { font-size: 0.95rem; }

.icon-badge {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-dim); color: var(--blue-bright); margin-bottom: 18px;
  border: 1px solid rgba(61,123,255,0.22);
}
.icon-badge.green { background: var(--green-dim); color: var(--green); border-color: rgba(35,192,138,0.25); }
.icon-badge svg { width: 22px; height: 22px; }

/* app logos (shared across home, apps list, and detail pages) */
.app-logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.app-logo svg { width: 24px; height: 24px; }
.app-logo.leaf { background: var(--green-dim); color: var(--green); border: 1px solid rgba(35,192,138,0.25); }
.app-logo.nest { background: var(--blue-dim); color: var(--blue-bright); border: 1px solid rgba(61,123,255,0.25); }
.app-logo.fish { background: rgba(91,147,255,0.1); color: #8fb4ff; border: 1px solid rgba(61,123,255,0.2); }
.app-logo.lg { width: 64px; height: 64px; border-radius: 18px; }
.app-logo.lg svg { width: 32px; height: 32px; }
/* real app-icon artwork: fills the tile, keeps its own baked-in background */
.app-logo.has-icon { background: none; border: 0; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.28); }
.app-logo.has-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Pills, tags, status ---- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.4em 0.8em; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line-2); color: var(--text-2);
}
.status {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.03em; color: var(--text-2);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
.status .dot.amber { background: #e0a13c; box-shadow: 0 0 0 4px rgba(224,161,60,0.16); }
.dot-pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-list { list-style: none; display: grid; gap: 11px; margin-top: 4px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--text-2); font-size: 0.96rem; }
.feature-list li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 5px;
  background: var(--blue-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b93ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
  border: 1px solid rgba(61,123,255,0.22);
}
.feature-list.green li::before {
  background: var(--green-dim) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2323c08a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: rgba(35,192,138,0.25);
}

/* ---- Backgrounds & decoration ---- */
.bg-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 80%);
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--blue-glow), transparent 70%);
  opacity: 0.5;
}
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* =============================================================
   NAVBAR (injected by site.js)
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(7,8,10,0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--text); }
.brand .mark { height: 30px; width: auto; flex: none; display: block; }
.brand .ai { color: var(--blue-bright); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 0.92rem; font-weight: 500; color: var(--text-2);
  padding: 8px 14px; border-radius: 9px; transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 9px; width: 42px; height: 42px; place-items: center; color: var(--text); }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 940px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-toggle { display: grid; }
}

/* mobile drawer */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: rgba(7,8,10,0.97); backdrop-filter: blur(8px);
  padding: 24px; display: flex; flex-direction: column; gap: 6px;
  transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  overflow-y: auto;
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--text); padding: 14px 8px; border-bottom: 1px solid var(--line); }
.mobile-menu a.active { color: var(--blue-bright); }
.mobile-menu .btn { margin-top: 18px; }

/* =============================================================
   FOOTER (injected by site.js)
   ============================================================= */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 64px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer .brand { margin-bottom: 16px; }
.footer-about p { font-size: 0.92rem; max-width: 320px; }
.footer-col h5 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; }
.footer-col ul { list-style: none; display: grid; gap: 11px; }
.footer-col a { font-size: 0.92rem; color: var(--text-2); transition: color .18s; }
.footer-col a:hover { color: var(--blue-bright); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer-bottom p { font-size: 0.85rem; color: var(--text-3); }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-2); transition: all .18s; }
.footer-social a:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,0.04); }
.footer-social svg { width: 18px; height: 18px; }

/* =============================================================
   FORMS
   ============================================================= */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.field label .req { color: var(--blue-bright); }
.field .hint { font-size: 0.8rem; color: var(--text-3); }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 0.8em 0.95em; color: var(--text); font-size: 0.95rem; transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c727d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim);
}
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: #e0556b; box-shadow: 0 0 0 3px rgba(224,85,107,0.14); }
.field .error-msg { font-size: 0.8rem; color: #f0859a; display: none; }
.field.invalid .error-msg { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.form-note { font-size: 0.82rem; color: var(--text-3); margin-top: 6px; }
.form-success {
  display: none; align-items: flex-start; gap: 14px; padding: 20px;
  background: var(--green-dim); border: 1px solid rgba(35,192,138,0.3); border-radius: var(--radius); margin-bottom: 20px;
}
.form-success.show { display: flex; }
.form-success svg { flex: none; width: 24px; height: 24px; color: var(--green); margin-top: 2px; }
.form-success p { color: var(--text); font-size: 0.95rem; }

.form-error {
  display: none; align-items: flex-start; gap: 14px; padding: 16px 18px;
  background: rgba(224,85,107,0.1); border: 1px solid rgba(224,85,107,0.32); border-radius: var(--radius); margin-bottom: 20px;
}
.form-error.show { display: flex; }
.form-error svg { flex: none; width: 22px; height: 22px; color: #f0859a; margin-top: 1px; }
.form-error p { color: #f7c2cc; font-size: 0.9rem; margin: 0; }

/* =============================================================
   PHONE MOCKUP (placeholder app screenshots)
   ============================================================= */
.phone {
  width: 250px; aspect-ratio: 9 / 19.5; flex: none;
  background: #0a0c10; border: 9px solid #1a1d24; border-radius: 38px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.04);
  position: relative; overflow: hidden;
}
.phone::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 70px; height: 6px; border-radius: 99px; background: #2a2e37; z-index: 5; }
.phone-screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 34px 14px 16px; }
.placeholder-note { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-3); letter-spacing: 0.05em; z-index: 6; }
.screen-stripe {
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 10px, transparent 10px 20px);
}

/* =============================================================
   FAQ / Accordion
   ============================================================= */
.faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q { width: 100%; text-align: left; background: none; border: 0; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--text); }
.faq-q .chev { flex: none; width: 20px; height: 20px; color: var(--text-3); transition: transform .25s; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); color: var(--blue-bright); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 24px 22px; color: var(--text-2); font-size: 0.95rem; }

/* =============================================================
   Legal / prose pages
   ============================================================= */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin: 44px 0 14px; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.prose p { margin-bottom: 14px; line-height: 1.7; }
.prose ul { margin: 0 0 16px 0; padding-left: 22px; display: grid; gap: 8px; }
.prose li { color: var(--text-2); }
.prose a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; }
.legal-toc { position: sticky; top: 90px; align-self: start; }
.legal-toc h5 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.legal-toc ul { list-style: none; display: grid; gap: 9px; }
.legal-toc a { font-size: 0.88rem; color: var(--text-2); transition: color .15s; }
.legal-toc a:hover { color: var(--blue-bright); }
.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .legal-layout { grid-template-columns: 1fr; } .legal-toc { display: none; } }

.callout { border: 1px solid var(--line-2); border-left: 3px solid var(--blue); background: var(--surface); border-radius: var(--radius-sm); padding: 18px 20px; margin: 22px 0; }
.callout.amber { border-left-color: #e0a13c; }
.callout.green { border-left-color: var(--green); }
.callout p { font-size: 0.92rem; margin: 0; }
.callout strong { color: var(--text); }

/* =============================================================
   Reveal animation
   ============================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ---- store badges ---- */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px; padding: 10px 18px;
  border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255,255,255,0.03);
  color: var(--text); opacity: 0.85;
}
.store-badge svg { width: 24px; height: 24px; flex: none; }
.store-badge .sb-top { font-size: 0.62rem; color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.05em; }
.store-badge .sb-main { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; line-height: 1.1; }
.store-badge .coming { font-family: var(--font-mono); font-size: 0.6rem; color: var(--blue-bright); }

/* utility spacing */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-2{gap:16px}.gap-3{gap:24px}.wrap{flex-wrap:wrap}
