/* Chattu learn hub — onboarding / education (not a traditional blog layout) */
:root {
  color-scheme: dark;
  --cb-bg: #0b1220;
  --cb-surface: rgba(17, 24, 39, 0.85);
  --cb-surface-2: rgba(31, 41, 55, 0.65);
  --cb-text: #f1f5f9;
  --cb-muted: #94a3b8;
  --cb-line: rgba(148, 163, 184, 0.22);
  --cb-brand: #25d366;
  --cb-brand-dim: rgba(37, 211, 102, 0.15);
  --cb-warn-bg: rgba(251, 191, 36, 0.1);
  --cb-warn-border: rgba(251, 191, 36, 0.35);
  --cb-radius: 14px;
  --cb-shadow: 0 22px 55px rgba(2, 6, 23, 0.42);
  --cb-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cb-prose: 65ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.cb-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cb-font);
  background: radial-gradient(ellipse 120% 70% at 10% -25%, rgba(37, 211, 102, 0.13), transparent 50%),
    radial-gradient(circle at 95% 15%, rgba(18, 140, 126, 0.12), transparent 38%), var(--cb-bg);
  color: var(--cb-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.cb-skip:focus {
  width: auto;
  height: auto;
  clip: auto;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 0.65rem 1rem;
  margin: 0;
  background: var(--cb-brand);
  color: #042;
  font-weight: 700;
  border-radius: 10px;
}

/* —— Top bar —— */
.cb-bar {
  border-bottom: 1px solid var(--cb-line);
  background: rgba(11, 18, 32, 0.75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cb-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}

.cb-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--cb-brand), #128c7e);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.28);
}

.cb-brand svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.cb-bar-links {
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.cb-bar-links a {
  color: var(--cb-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.cb-bar-links a:hover {
  color: var(--cb-brand);
}

.cb-bar-nav-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

/* Author `display:flex` beats the UA `[hidden]` rule; mirror JS `.hidden` for non-Tailwind pages. */
.cb-bar-nav-cluster[hidden],
.cb-bar-nav-cluster.hidden {
  display: none !important;
}

.cb-bar-links button.cb-bar-logout {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: var(--cb-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0;
}

.cb-bar-links button.cb-bar-logout:hover {
  color: var(--cb-brand);
}

/* —— Layout —— */
.cb-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.cb-hero {
  text-align: center;
  padding: 2rem 0 2.25rem;
}

.cb-hero h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.cb-hero p {
  margin: 1rem auto 0;
  max-width: 560px;
  color: var(--cb-muted);
  font-size: 1.06rem;
}

.cb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 211, 102, 0.35);
  background: var(--cb-brand-dim);
  color: #c9f7df;
}

/* —— Search + filters —— */
.cb-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 720px) {
  .cb-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cb-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.cb-search input {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.85rem;
  border-radius: 12px;
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  color: var(--cb-text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cb-search input::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.cb-search input:focus {
  border-color: rgba(37, 211, 102, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.16);
}

.cb-search svg {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.48;
}

.cb-categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (min-width: 720px) {
  .cb-categories {
    justify-content: flex-end;
    flex-shrink: 0;
  }
}

.cb-chip {
  border: 1px solid var(--cb-line);
  background: transparent;
  color: var(--cb-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cb-chip:hover {
  border-color: rgba(37, 211, 102, 0.35);
  color: var(--cb-text);
}

.cb-chip.cb-chip--active {
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.45);
  color: #d9ffe8;
}

/* —— Cards —— */
.cb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

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

.cb-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  padding: 1.35rem 1.35rem 1.2rem;
  background: linear-gradient(168deg, var(--cb-surface), var(--cb-surface-2));
  box-shadow: var(--cb-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.cb-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 211, 102, 0.28);
}

.cb-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.cb-tag {
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.52rem;
  border-radius: 6px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.25);
  color: #b6f8d6;
}

.cb-read {
  font-size: 0.8rem;
  color: var(--cb-muted);
  white-space: nowrap;
}

.cb-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.cb-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--cb-muted);
  flex: 1;
  line-height: 1.5;
}

.cb-card-actions {
  margin-top: 1.05rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cb-brand);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cb-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--cb-muted);
  border: 1px dashed var(--cb-line);
  border-radius: var(--cb-radius);
  background: rgba(17, 24, 39, 0.4);
}

.cb-empty strong {
  color: var(--cb-text);
  display: block;
  margin-bottom: 0.35rem;
}

/* —— Article —— */
.cb-article-shell {
  max-width: calc(var(--cb-prose) + 7rem);
  margin: 0 auto;
}

.cb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--cb-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.cb-back:hover {
  color: var(--cb-brand);
}

.cb-article-head {
  margin-bottom: 2rem;
}

.cb-article-head h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.65rem, 3.8vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.cb-article-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--cb-muted);
}

.cb-intro {
  font-size: 1.1rem;
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.cb-blocks h2 {
  font-size: 1.2rem;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.cb-blocks p {
  margin: 0 0 1rem;
  color: #cbd5e1;
}

.cb-blocks ul,
.cb-blocks ol {
  margin: 0 0 1.1rem 1.25rem;
  padding: 0;
  color: #cbd5e1;
}

.cb-blocks li + li {
  margin-top: 0.38rem;
}

.cb-callout {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 1.35rem 0;
  border: 1px solid var(--cb-line);
}

.cb-callout--tip {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.26);
}

.cb-callout--warn {
  background: var(--cb-warn-bg);
  border-color: var(--cb-warn-border);
}

.cb-callout h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.cb-callout--tip h3 {
  color: #b6f8d6;
}

.cb-callout--warn h3 {
  color: #fde68a;
}

.cb-callout p {
  margin: 0;
  font-size: 0.92rem;
  color: #e5e7eb;
}

.cb-code {
  margin: 1.35rem 0;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--cb-line);
  overflow-x: auto;
}

.cb-code pre {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.56;
  color: #dbeafe;
  white-space: pre;
}

.cb-divider {
  border: none;
  height: 1px;
  background: var(--cb-line);
  margin: 2rem 0;
}

.cb-next {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cb-line);
}

.cb-next a {
  display: block;
  text-decoration: none;
  padding: 1.15rem 1.25rem;
  border-radius: var(--cb-radius);
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  color: inherit;
  transition: border-color 0.15s, transform 0.15s ease;
}

.cb-next a:hover {
  border-color: rgba(37, 211, 102, 0.35);
  transform: translateY(-2px);
}

.cb-next span {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cb-brand);
}

.cb-next h2 {
  margin: 0.35rem 0 0;
  font-size: 1.06rem;
}

.cb-next p {
  margin: 0.45rem 0 0;
  font-size: 0.87rem;
  color: var(--cb-muted);
}

.cb-notfound {
  text-align: center;
  padding: 3rem 1rem;
}

.cb-notfound h1 {
  margin: 0 0 0.5rem;
}

.cb-footer {
  text-align: center;
  padding: 2rem 1rem 2.75rem;
  color: rgba(148, 163, 184, 0.55);
  font-size: 0.82rem;
}
