/* ===========================
   Onyx Landing Page — style.css
   Mobile-first, no build step
   =========================== */

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

:root {
  --color-bg: #0a0a0f;
  --color-surface: #111118;
  --color-surface-2: #18181f;
  --color-border: rgba(255,255,255,0.08);
  --color-border-subtle: rgba(255,255,255,0.04);
  --color-text: #f0f0f5;
  --color-text-muted: #9090a8;
  --color-text-dim: #606075;
  --color-accent: #7C3AED;
  --color-accent-light: #a78bfa;
  --color-accent-bg: rgba(124, 58, 237, 0.12);
  --color-success: #4ade80;
  --color-code-bg: #0d0d14;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --max-width: 1100px;
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 640px) { .container { padding: 0 var(--space-lg); } }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.15s;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: #6d28d9; }
.btn-primary:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.18); color: var(--color-text); }
.btn-ghost:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 3px; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}
.logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: none;
  align-items: center;
  gap: var(--space-md);
}

.nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav a:hover { color: var(--color-text); }

.nav-cta {
  background: var(--color-accent-bg) !important;
  color: var(--color-accent-light) !important;
  border: 1px solid rgba(124,58,237,0.3) !important;
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
}
.nav-cta:hover {
  background: rgba(124,58,237,0.2) !important;
  color: #c4b5fd !important;
}

@media (min-width: 640px) { .nav { display: flex; } }

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-muted);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
@media (min-width: 640px) { .mobile-menu-toggle { display: none; } }

/* --- Section shared --- */
.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: var(--space-sm);
}

section h2 {
  font-size: clamp(1.625rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  max-width: 28ch;
  margin-bottom: var(--space-lg);
}

/* --- Hero --- */
.hero {
  padding: var(--space-xl) 0;
}

@media (min-width: 640px) {
  .hero { padding: var(--space-2xl) 0; }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

@media (min-width: 900px) {
  .hero-inner {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-lg);
  }
  .hero-copy { flex: 1; max-width: 520px; }
  .hero-code { flex: 1; }
}

.badge {
  display: inline-block;
  background: var(--color-accent-bg);
  color: var(--color-accent-light);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.3rem 0.875rem;
  margin-bottom: var(--space-md);
}

.hero h1 {
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #f0f0f5 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 42ch;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Code window --- */
.code-window {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(255,255,255,0.02);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.code-window-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.code-content {
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  tab-size: 2;
}

.code-content code { font-family: inherit; }

.code-prompt { color: var(--color-text-dim); user-select: none; }
.code-cmd    { color: #93c5fd; }
.code-arg    { color: #86efac; }
.code-dim    { color: var(--color-text-dim); }
.code-success{ color: var(--color-success); }
.code-section{ color: #60a5fa; }
.code-wit    { color: #c084fc; }

/* --- Problem --- */
.problem {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.problem-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .problem-grid { grid-template-columns: repeat(3, 1fr); }
}

.problem-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.problem-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.problem-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.problem-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Features --- */
.solution {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.features-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: rgba(124,58,237,0.35); }

.feature-card--highlight {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(124,58,237,0.06) 100%);
  border-color: rgba(124,58,237,0.2);
}

.feature-icon {
  margin-bottom: 0.875rem;
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- How it works --- */
.how-it-works {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.steps {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-xl);
}

@media (min-width: 800px) {
  .steps {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
  }
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: var(--space-md);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  opacity: 0.7;
}

.step-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-content p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.step-content em { color: var(--color-text); font-style: normal; font-weight: 500; }

.step-connector {
  width: 2px;
  height: 2rem;
  background: var(--color-border);
  margin: 0 auto;
  flex-shrink: 0;
}

@media (min-width: 800px) {
  .step-connector {
    width: 2rem;
    height: 2px;
    margin: 0;
    align-self: center;
  }
}

.workflow-code .code-content { font-size: 0.8rem; }

/* --- Trust --- */
.trust {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.trust-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  text-align: center;
  margin-bottom: var(--space-md);
}

.trust-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .trust-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-md);
}

.trust-item strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.trust-item span {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.trust-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
  display: none;
}

@media (min-width: 640px) { .trust-divider { display: block; } }

/* --- Waitlist --- */
.waitlist {
  padding: var(--space-2xl) 0;
}

.waitlist-inner {
  text-align: center;
  max-width: 560px;
}

.waitlist h2 {
  margin: 0 auto var(--space-sm);
  max-width: none;
}

.waitlist p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  font-size: 1.0625rem;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .form-row {
    flex-direction: row;
  }
  .form-row input { flex: 1; }
}

.waitlist-form input[type="email"] {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-text);
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

.waitlist-form input[type="email"]::placeholder { color: var(--color-text-dim); }
.waitlist-form input[type="email"]:focus { border-color: var(--color-accent); }

.form-note {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  margin: 0 !important;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand .logo { margin-bottom: 0.5rem; }
.footer-brand p { font-size: 0.875rem; color: var(--color-text-muted); }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--color-text); }

.footer-bottom {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-subtle);
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

/* --- Form success state --- */
.form-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: var(--radius-sm);
  color: var(--color-success);
  font-size: 0.9375rem;
  padding: 0.875rem 1.25rem;
  text-align: center;
}

/* --- Mobile nav drawer (JS-enhanced) --- */
.nav-open .nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .nav-open .nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    padding: 0;
    border: none;
    gap: var(--space-md);
    align-items: center;
  }
}
