/* nodecam-help theme — matches node.video's dark Next.js look */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds (from node.video) */
  --background: #0f0f0f;
  --background-secondary: #1a1a1a;
  --background-tertiary: #252525;
  --border: #2a2a2a;

  /* Brand accents */
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-dark: #0891b2;
  --amber: #f59e0b;

  /* Text */
  --text: #e5e7eb;
  --text-muted: #99a1af;
  --text-dim: #6a7282;

  /* Fonts */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  /* Layout */
  --radius: 12px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--cyan-light);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.kb-header {
  border-bottom: 1px solid var(--border);
  padding: 32px 24px 24px;
  background: var(--background-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.kb-header-logo-link {
  display: inline-block;
  line-height: 0;
  border-radius: 4px;
  transition: opacity 0.15s ease, transform 0.2s ease;
}
.kb-header-logo-link:hover { opacity: 0.85; transform: translateY(-1px); }
.kb-header-logo-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 6px;
}
.kb-header-logo {
  width: 220px;
  height: 64px;
  object-fit: contain;
  filter: invert(1);
  display: block;
}
.kb-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ── Nav (breadcrumb / home link) ──────────────────────────────────── */
.kb-nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.kb-nav-home,
.kb-nav-breadcrumb {
  color: var(--text-muted);
  text-decoration: none;
}
.kb-nav-home:hover,
.kb-nav-breadcrumb:hover {
  color: var(--cyan-light);
}

/* ── Main content area ─────────────────────────────────────────────── */
.kb-content {
  max-width: 860px;
  margin: 24px auto 64px;
  padding: 0 24px;
}

/* ── Article (single-page) ─────────────────────────────────────────── */
.kb-article {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.kb-article h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 24px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.kb-article h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 36px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.kb-article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--text);
}
.kb-article p {
  margin: 12px 0;
}
.kb-article ul, .kb-article ol {
  margin: 12px 0;
  padding-left: 24px;
}
.kb-article li {
  margin: 6px 0;
}
.kb-article code {
  background: var(--background-tertiary);
  color: var(--cyan-light);
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.kb-article pre {
  background: #050505;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 16px 0;
}
.kb-article pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}
.kb-article blockquote {
  border-left: 3px solid var(--cyan);
  background: var(--background-tertiary);
  margin: 16px 0;
  padding: 12px 18px;
  color: var(--text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Index page (homepage) ─────────────────────────────────────────── */
.kb-index .kb-content {
  background: transparent;
}
.kb-index-product {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 18px;
}
.kb-index-product h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.kb-index-product h3 {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 18px 0 6px;
}
.kb-index-product ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kb-index-product li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.kb-index-product li:last-child {
  border-bottom: 0;
}
.kb-index-product a {
  display: block;
  padding: 4px 0;
}
.kb-index-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.kb-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-dim);
}
.kb-footer a {
  color: var(--text-muted);
}

/* ── Deprecated banner (RFC §3.4) ──────────────────────────────────── */
.deprecated-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--amber);
  color: var(--amber);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 0.875rem;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .kb-header { padding: 20px 16px; }
  .kb-header h1 { font-size: 1.375rem; }
  .kb-nav, .kb-content { padding-left: 16px; padding-right: 16px; }
  .kb-article { padding: 24px 20px; }
  .kb-article h1 { font-size: 1.5rem; }
  .kb-article h2 { font-size: 1.125rem; }
}


/* ── Support section (editorial dark, accent rail, floating-label inputs) ─── */

.kb-support {
  position: relative;
  margin: 80px 0 24px;
  padding: 56px 0 56px 40px;
  background:
    radial-gradient(800px 320px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.015) 100%);
  border-top: 1px solid var(--border);
}
.kb-support-rail {
  position: absolute;
  left: 0;
  top: 56px;
  bottom: 56px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan) 35%, transparent 100%);
}
.kb-support-inner { max-width: 640px; }

.kb-support-eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
}

.kb-support-title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.kb-support-lede {
  margin: 0 0 36px;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ── Form layout ─────────────────────────────────────────────────────── */
.kb-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.kb-field-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) 1.2fr;
  gap: 28px;
}

/* ── Field with floating label ───────────────────────────────────────── */
.kb-field {
  position: relative;
}
.kb-field input,
.kb-field select,
.kb-field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 22px 0 8px;
  transition: border-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.kb-field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.55;
  padding-top: 24px;
}
.kb-field input::placeholder,
.kb-field textarea::placeholder { color: transparent; }

.kb-field label {
  position: absolute;
  left: 0;
  top: 26px;
  pointer-events: none;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-dim);
  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease, letter-spacing 0.2s ease;
}

/* Float the label up when focused or filled */
.kb-field input:focus + label,
.kb-field input:not(:placeholder-shown) + label,
.kb-field textarea:focus + label,
.kb-field textarea:not(:placeholder-shown) + label,
.kb-field--select select:focus ~ label,
.kb-field--select select:not([value=""]) ~ label {
  top: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Bottom-border accent on focus */
.kb-field input:focus,
.kb-field select:focus,
.kb-field textarea:focus {
  outline: none;
  border-bottom-color: var(--cyan);
  color: var(--text);
}
.kb-field input:focus + label,
.kb-field textarea:focus + label,
.kb-field--select select:focus ~ label {
  color: var(--cyan);
}

/* Required tag */
.kb-req {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--text-dim);
  opacity: 0.7;
}

/* Select needs custom arrow since we hid native */
.kb-field--select { position: relative; }
.kb-field--select select { cursor: pointer; padding-right: 24px; }
.kb-field--select select option {
  background: var(--background-secondary);
  color: var(--text);
}
.kb-field-arrow {
  position: absolute;
  right: 0;
  top: 28px;
  pointer-events: none;
  font-size: 0.875rem;
  color: var(--text-dim);
  transition: color 0.2s ease, transform 0.2s ease;
}
.kb-field--select select:focus ~ .kb-field-arrow { color: var(--cyan); transform: translateY(2px); }

/* Selects don't have :placeholder-shown — force label up always */
.kb-field--select label { top: 0; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }

/* ── Submit ─────────────────────────────────────────────────────────── */
.kb-form-send {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: 4px;
  background: transparent;
  border: 1px solid var(--cyan);
  border-radius: 0;
  color: var(--cyan);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 20px;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.2s ease, border-color 0.2s ease;
  isolation: isolate;
}
.kb-form-send::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.kb-form-send:hover { color: #0a0a0a; }
.kb-form-send:hover::before { transform: scaleX(1); }
.kb-form-send-arrow {
  display: inline-block;
  font-family: var(--font-mono);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.kb-form-send:hover .kb-form-send-arrow { transform: translateX(4px); }
.kb-form-send:disabled { opacity: 0.5; cursor: not-allowed; }
.kb-form-send:disabled:hover::before { transform: scaleX(0); }

/* ── Status message ─────────────────────────────────────────────────── */
.kb-form-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  min-height: 1.5em;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.kb-form-status:not(:empty) { opacity: 1; transform: translateY(0); }
.kb-form-status-success { color: #34d399; }
.kb-form-status-success::before { content: "● "; }
.kb-form-status-error { color: #f87171; }
.kb-form-status-error::before { content: "● "; }

/* ── Reveal-on-load (subtle, only first paint) ──────────────────────── */
.kb-support-eyebrow,
.kb-support-title,
.kb-support-lede,
.kb-form > * {
  animation: kb-rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
.kb-support-eyebrow { animation-delay: 0ms; }
.kb-support-title   { animation-delay: 60ms; }
.kb-support-lede    { animation-delay: 120ms; }
.kb-form > *:nth-child(1) { animation-delay: 180ms; }
.kb-form > *:nth-child(2) { animation-delay: 220ms; }
.kb-form > *:nth-child(3) { animation-delay: 260ms; }
.kb-form > *:nth-child(4) { animation-delay: 300ms; }
.kb-form > *:nth-child(5) { animation-delay: 340ms; }

@keyframes kb-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .kb-support {
    margin-top: 48px;
    padding: 40px 0 40px 24px;
  }
  .kb-support-title { font-size: 1.375rem; }
  .kb-field-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Homepage 2-column layout (articles left, form right; stacks on narrow) ── */
.kb-home {
  max-width: 1140px;
}
.kb-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: start;
}
.kb-home-articles { min-width: 0; }
.kb-home-aside { min-width: 0; }

/* When the form lives in the aside, tighten the section to fit the column */
.kb-home-aside .kb-support {
  margin: 0;
  padding: 32px 0 32px 28px;
  background:
    radial-gradient(420px 240px at 100% 0%, rgba(34, 211, 238, 0.06), transparent 65%);
  border-top: 0;
  position: sticky;
  top: 24px;
}
.kb-home-aside .kb-support-rail {
  top: 32px;
  bottom: 32px;
}
.kb-home-aside .kb-support-title { font-size: 1.375rem; }
.kb-home-aside .kb-support-lede {
  margin-bottom: 28px;
  max-width: 100%;
  font-size: 0.875rem;
}
.kb-home-aside .kb-form { gap: 24px; }

/* Drop to single column when the aside can no longer fit comfortably */
@media (max-width: 980px) {
  .kb-home-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .kb-home-aside .kb-support {
    margin-top: 56px;
    padding: 48px 0 24px 32px;
    border-top: 1px solid var(--border);
    background:
      radial-gradient(800px 320px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 60%);
    position: static;
  }
  .kb-home-aside .kb-support-title { font-size: 1.75rem; }
  .kb-home-aside .kb-support-lede { font-size: 0.9375rem; max-width: 56ch; }
  .kb-home-aside .kb-form { gap: 28px; }
}
