/* cubby.network — site styles.
 *
 * Design intent: technical, audit-aware, quiet. Dark background because
 * most operators reading this site live in terminals. Mono-heavy for the
 * same reason. Teal accent because it looks like a healthy link-state.
 */

:root {
  --bg:        #0b0f14;
  --surface:   #111821;
  --surface-2: #0e141c;
  --border:    #1e2935;
  --text:      #e6e8eb;
  --text-dim:  #9aa3ae;
  --text-mute: #5c6672;
  --accent:    #2dd4bf;
  --accent-d:  #14b8a6;
  --link:      #7aa2f7;
  --warn:      #f59e0b;
  --danger:    #ef4444;

  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --content-width: 860px;
  --wide-width:    1080px;
}

* { box-sizing: border-box; }

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

::selection { background: var(--accent); color: var(--bg); }

/* ---------- Nav ---------- */

.nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(11, 15, 20, 0.82);
}

.nav-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.brand-name {
  font-size: 1.02rem;
}

.brand-tag {
  color: var(--text-mute);
  font-weight: 400;
  margin-left: 0.35rem;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  font-size: 0.93rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim) !important;
}
.nav-github:hover { border-color: var(--accent); color: var(--text) !important; }

/* ---------- Layout ---------- */

main { padding-bottom: 4rem; }

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4rem 0; }
section.tight { padding: 2.5rem 0; }
section + section { border-top: 1px solid var(--border); }

/* ---------- Hero ---------- */

.hero {
  padding: 5rem 0 4rem;
  text-align: left;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface);
  margin-bottom: 1.5rem;
}

.hero-meta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

h1.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
  font-weight: 700;
}

h1.hero-title .accent { color: var(--accent); }

.hero-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 0 2rem;
}

.cta-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.hero-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 640px;
  overflow-x: auto;
}
.hero-code .prompt { color: var(--accent); user-select: none; }
.hero-code .comment { color: var(--text-mute); }

/* ---------- Section headings ---------- */

.section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

h2.section-title {
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.section-lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 0 2.5rem;
}

/* ---------- Feature grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  transition: border-color 0.15s ease;
}
.feature:hover { border-color: var(--accent); }

.feature-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.feature h3 {
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.feature p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

/* ---------- How it works (flow) ---------- */

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.flow-step {
  padding: 0.9rem 0.6rem;
  text-align: center;
  border-radius: 6px;
  background: var(--surface-2);
  position: relative;
}

.flow-step-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-mute);
  margin-bottom: 0.35rem;
}

.flow-step-name {
  font-size: 0.9rem;
  color: var(--text);
}

.flow-step-detail {
  font-size: 0.77rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ---------- Guarantee list ---------- */

.guarantees {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.guarantee {
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}

.guarantee strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.98rem;
}

.guarantee span {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------- Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.stat {
  padding: 1.4rem 1.2rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }

.stat-value {
  font-family: var(--mono);
  font-size: 1.8rem;
  color: var(--accent);
  line-height: 1;
  font-weight: 500;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Code block ---------- */

pre.code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  margin: 0;
}

pre.code .comment { color: var(--text-mute); }
pre.code .prompt  { color: var(--accent); user-select: none; }
pre.code .str     { color: #9ece6a; }

code.inline {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.08em 0.35em;
  border-radius: 4px;
  color: var(--text);
}

/* ---------- Prose (docs pages) ---------- */

.prose {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.prose h1 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.prose h2:first-of-type { border-top: none; padding-top: 0; margin-top: 2rem; }

.prose h3 {
  font-size: 1.15rem;
  margin: 1.8rem 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.prose p {
  color: var(--text);
  margin: 0 0 1rem;
}

.prose a { color: var(--link); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

.prose ul, .prose ol { padding-left: 1.4rem; color: var(--text); }
.prose li { margin-bottom: 0.4rem; }

.prose code:not(.inline) {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0 0 1.2rem;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.4rem 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 0 4px 4px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.93rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  text-align: left;
}
.prose th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}
.prose td { color: var(--text); }
.prose tr:nth-child(even) td { background: var(--surface-2); }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose-meta {
  font-family: var(--mono);
  font-size: 0.83rem;
  color: var(--text-mute);
  padding-bottom: 1.2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* ---------- Docs index ---------- */

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: block;
}
.doc-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.doc-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.doc-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}
.doc-card-meta {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--text-mute);
  margin-top: 0.9rem;
  letter-spacing: 0.03em;
}

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
  font-size: 0.88rem;
  color: var(--text-mute);
  background: var(--surface-2);
}

.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 0 0 0.8rem;
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.2rem 0;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--wide-width);
  margin: 2rem auto 0;
  padding: 1.2rem 1.5rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Small ---------- */

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner .nav-github { display: inline-flex; }
  section { padding: 3rem 0; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .footer-inner { flex-direction: column; gap: 1.5rem; }
}
