/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(11, 15, 20, 0.78);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--blue);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.6);
}

.brand-text { color: var(--heading); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav > a,
.nav-link {
  transition: color .2s ease;
  color: var(--muted);
  padding: 4px 0;
  cursor: pointer;
}

.site-nav > a:hover,
.site-nav > a.is-active,
.nav-link:hover { color: #fff; }

.nav-item { position: relative; }

.nav-item.has-children .nav-link::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  display: inline-block;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: all .22s ease;
}

.nav-item.has-children::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 14px;
  pointer-events: none;
}

.nav-item.has-children:hover::after,
.nav-item.has-children:focus-within::after {
  pointer-events: auto;
}

.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

.nav-dropdown a:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.12);
}

.nav-item.has-children:hover .nav-dropdown,
.nav-item.has-children:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.search-box {
  min-width: 220px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 6px 0 14px;
  gap: 8px;
  color: var(--muted-2);
  font-size: 13px;
  transition: border-color .2s ease;
}

.search-box:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.kbd {
  padding: 3px 9px;
  border-radius: 6px;
  background: #020617;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: .2s ease;
}

button.kbd {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--blue-light);
}

button.kbd:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
}

.nav-toggle span + span { margin-top: 5px; }

/* ============ Hero ============ */
.hero-section { padding: 0; }

.hero-carousel { position: relative; }

.hero-slide {
  display: none;
  padding: 90px 0 40px;
  position: relative;
  overflow: hidden;
}

.hero-slide.is-active { display: block; }

.hero-media {
  position: absolute;
  top: -30px;
  right: -30px;
  bottom: -30px;
  left: -30px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  filter: blur(14px) saturate(1.2);
  opacity: 0.7;
  transform: scale(1.06);
}

.hero-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 25% 20%, rgba(59, 130, 246, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(11, 15, 20, 0.2) 0%, rgba(11, 15, 20, 0.55) 55%, rgba(11, 15, 20, 0.75) 100%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-copy { min-width: 0; }

.eyebrow,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-light);
  font-size: 13px;
  margin-bottom: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  border: 1px solid rgba(59, 130, 246, 0.18);
  width: fit-content;
}

.hero-copy h1,
.page-banner-inner h1,
.article-copy h1,
.article-head h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.08;
  color: var(--heading);
  font-family: var(--font);
}

.hero-copy h1 {
  font-size: clamp(28px, 3.6vw, 46px);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.hero-copy h1 a { color: inherit; }

.hero-copy p,
.page-banner-inner p,
.article-summary {
  color: var(--muted);
  margin: 22px 0 0;
  font-size: 17px;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.button {
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: .2s ease;
  cursor: pointer;
  text-decoration: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border-color: rgba(59, 130, 246, .75);
  box-shadow: 0 12px 30px rgba(37, 99, 235, .25);
  color: #fff;
}

.button-secondary { color: var(--text); }
.button:hover { transform: translateY(-1px); border-color: rgba(59, 130, 246, 0.5); }

.hero-side-visual { position: relative; }

.code-window {
  background: linear-gradient(180deg, #0f172a, #0b111c);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-window-top {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.code-dot:nth-child(1) { background: var(--red); }
.code-dot:nth-child(2) { background: var(--yellow); }
.code-dot:nth-child(3) { background: var(--green); }

.code-window pre {
  margin: 0;
  padding: 24px;
  overflow: auto;
  font-family: var(--mono);
  color: var(--body);
  font-size: 13px;
  line-height: 1.9;
  background: transparent;
  border: 0;
}

.cw-kw { color: #60a5fa; }
.cw-str { color: #86efac; }
.cw-fn { color: var(--purple); }
.cw-cm { color: var(--muted-2); }

/* ============ Hero carousel controls ============ */
.hero-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 8px 0 40px;
}

.hero-arrow {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.6);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .2s ease;
  font-size: 14px;
}

.hero-arrow:hover {
  border-color: var(--blue);
  color: #fff;
}

.hero-dots { display: flex; gap: 8px; align-items: center; }

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: .2s ease;
}

.hero-dot.is-active {
  background: var(--blue);
  width: 22px;
  border-radius: 999px;
}

/* ============ Sections ============ */
.stream-section,
.featured-section,
.related-section,
.comment-section {
  padding: 40px 0 60px;
}

.section-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--heading);
  font-weight: 700;
}

.section-heading p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

/* ============ Home layout ============ */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.home-main { min-width: 0; }

.post-stack {
  display: grid;
  gap: 18px;
}

/* ============ Post card (list-style with thumb) ============ */
.post-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 18px;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: .2s ease;
}

.post-card:hover {
  border-color: rgba(59, 130, 246, .55);
  transform: translateY(-2px);
}

.post-card-media {
  display: block;
  min-height: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(59, 130, 246, .28), rgba(34, 197, 94, .08)), #020617;
  border: 1px solid var(--border);
  position: relative;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.35;
  font-weight: 700;
}

.post-card h3 a { color: inherit; }
.post-card h3 a:hover { color: var(--blue-light); }

.post-card p,
.post-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta,
.card-badge {
  font-size: 13px;
  color: var(--muted-2);
}

.card-meta {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-meta-right {
  display: flex;
  gap: 12px;
  color: var(--muted-2);
}

.tags-list,
.article-tags > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.tags-list a,
.tags-list span,
.article-tags a,
.card-badge-tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.11);
  color: var(--blue-light);
  font-size: 12px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  line-height: 1.4;
  display: inline-block;
}

.tag:hover,
.tags-list a:hover,
.article-tags a:hover {
  background: rgba(59, 130, 246, 0.22);
  color: #fff;
}

/* ============ Sidebar ============ */
.sidebar {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 100px;
}

.side-card {
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.side-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--heading);
  font-weight: 700;
}

.side-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

.side-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #64748b);
  margin-bottom: 14px;
  object-fit: cover;
}

.side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.side-stats strong {
  display: block;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.side-stats span {
  color: var(--muted-2);
  font-size: 12px;
}

.side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.side-list li { margin: 0; }

.side-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  padding: 4px 0;
  transition: color .2s ease;
}

.side-list a strong {
  color: inherit;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-list a span {
  color: var(--muted-2);
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
}

.side-list a:hover,
.side-list a:hover strong { color: #fff; }

.subscribe input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  margin: 12px 0 10px;
}

.subscribe .button { width: 100%; }

/* Terminal stats card */
.side-terminal {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a, #0a0f18);
}

.side-terminal .terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.side-terminal .terminal-title {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 8px;
  letter-spacing: 0.02em;
}

.side-terminal .terminal-body {
  margin: 0;
  padding: 14px 18px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--body);
  background: transparent;
  border: 0;
  overflow: hidden;
}

.side-terminal .t-prompt { color: var(--green); }
.side-terminal .t-cmd { color: #e5e7eb; }
.side-terminal .t-tree { color: var(--muted-2); }
.side-terminal .t-key { color: var(--muted); }
.side-terminal .t-val { color: #86efac; }

/* Latest comments */
.side-comments {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.side-comments li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.side-comments li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-comments .sc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.side-comments .sc-author {
  color: var(--blue-light);
  font-weight: 600;
  font-size: 13px;
}

.side-comments .sc-meta {
  color: var(--muted-2);
  font-size: 11px;
  font-family: var(--mono);
}

.side-comments .sc-text {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.side-comments .sc-on {
  color: var(--muted-2);
  font-size: 12px;
  display: inline-block;
}

.side-comments .sc-on a { color: var(--muted-2); }
.side-comments .sc-on a:hover { color: var(--blue-light); }

