/* ── Design tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          rgb(246,245,250);
  --surface:     rgb(255,255,255);
  --border:      rgb(231,230,235);
  --text:        rgb(16,0,31);
  --heading:     rgb(34,5,61);
  --muted:       rgb(110,100,130);
  --accent:      rgb(123,44,191);
  --accent-light:rgb(237,225,255);
  --rubik:       'Rubik', sans-serif;
  --poppins:     'Poppins', sans-serif;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--poppins);
  font-size: 16px;
  line-height: 1.6;
}

::selection { background: var(--accent-light); color: var(--heading); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@keyframes up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Nav ── */
.db-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  box-shadow: 0 4px 4px rgba(0,0,0,0.07);
  height: 72px;
  display: flex;
  align-items: center;
}

.db-nav__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.db-nav__logo {
  font-family: var(--rubik);
  font-weight: 700;
  font-size: 22px;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.db-nav__logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.db-nav__spacer { flex: 1; }

.db-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  padding: 0;
}

.db-nav__link {
  font-family: var(--poppins);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.db-nav__link:hover { color: var(--accent); }

.db-nav__rss {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 22px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  transition: background .18s;
  letter-spacing: .01em;
  flex-shrink: 0;
}
.db-nav__rss:hover { background: rgb(100,25,165); color: white; }

/* ── Page layout ── */
.db-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 40px 100px;
}

.db-page-heading {
  margin-bottom: 40px;
  animation: up .4s ease both;
}

.db-page-heading h1 {
  font-family: var(--rubik);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.8px;
  color: var(--heading);
  margin-bottom: 8px;
}

.db-page-heading p {
  font-family: var(--poppins);
  font-size: 15px;
  color: var(--muted);
}

.db-content-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

/* ── Chip / Tag ── */
.db-chip {
  font-family: var(--poppins);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  transition: all .15s;
  cursor: pointer;
  user-select: none;
}
.db-chip:hover, .db-chip--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Tag strip ── */
.db-tag-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Hero post ── */
.db-hero {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: box-shadow .25s, transform .25s, border-color .25s;
  cursor: pointer;
  animation: up .45s ease both;
  position: relative;
  margin-bottom: 28px;
  text-decoration: none;
  display: block;
  color: inherit;
}
.db-hero:hover {
  border-color: rgba(123,44,191,.35);
  box-shadow: 0 12px 48px rgba(123,44,191,.18);
  transform: translateY(-3px);
}

.db-hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(255,255,255) 55%, rgb(245,238,255) 100%);
  z-index: 0;
}

.db-hero__circle {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123,44,191,.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.db-hero__body {
  position: relative;
  z-index: 1;
  padding: 44px 52px;
}

.db-hero__top {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.db-hero__latest {
  font-family: var(--poppins);
  font-size: 10px;
  font-weight: 700;
  color: white;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
}

.db-hero__cols {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 52px;
  align-items: start;
}

.db-hero__left {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.db-hero__title {
  font-family: var(--rubik);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.7px;
  color: var(--heading);
}

.db-hero__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-avatar {
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--rubik);
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  text-align: center;
  overflow: hidden;
}
.db-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.db-avatar--sm { width: 36px; height: 36px; min-width: 36px; font-size: 14px; }
.db-avatar--md { width: 44px; height: 44px; min-width: 44px; font-size: 17px; }

.db-hero__avatar { box-shadow: 0 2px 8px rgba(123,44,191,.3); }

.db-author-name {
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.db-author-meta {
  font-family: var(--poppins);
  font-size: 12px;
  color: var(--muted);
}

.db-hero__right {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 4px;
}

.db-hero__excerpt {
  font-family: var(--poppins);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
}

.db-btn {
  display: inline-block;
  font-family: var(--poppins);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 22px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  transition: background .18s;
  letter-spacing: .01em;
  border: none;
  cursor: pointer;
}
.db-btn:hover { background: rgb(100,25,165); color: white; }

/* ── Cards grid ── */
.db-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.db-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: all .2s ease;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: up .4s ease both;
  text-decoration: none;
  color: inherit;
}
.db-card:hover {
  border-color: rgb(200,180,230);
  box-shadow: 0 6px 24px rgba(123,44,191,.1);
  transform: translateY(-3px);
}

.db-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }

.db-card__title {
  font-family: var(--rubik);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--heading);
  transition: color .18s;
}
.db-card:hover .db-card__title { color: var(--accent); }

.db-card__excerpt {
  font-family: var(--poppins);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.db-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.db-card__date {
  font-family: var(--poppins);
  font-size: 12px;
  color: var(--muted);
}

.db-card__read {
  font-family: var(--poppins);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity .18s;
}
.db-card:hover .db-card__read { opacity: 1; }

/* ── Sidebar ── */
.db-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 88px;
}

.db-sidebar-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
}

.db-sidebar-card__title {
  font-family: var(--rubik);
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  letter-spacing: -0.2px;
  margin-bottom: 16px;
}

.db-about__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.db-about__name {
  font-family: var(--rubik);
  font-weight: 600;
  font-size: 15px;
  color: var(--heading);
}

.db-about__tagline {
  font-family: var(--poppins);
  font-size: 12px;
  color: var(--muted);
}

.db-about__bio {
  font-family: var(--poppins);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}

.db-about__bio a { color: var(--accent); text-decoration: none; }
.db-about__bio a:hover { text-decoration: underline; }

.db-recent-post {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  transition: opacity .15s;
  text-decoration: none;
  color: inherit;
}
.db-recent-post:last-child { border-bottom: none; padding-bottom: 0; }
.db-recent-post:hover { opacity: .65; }

.db-recent-post__title {
  font-family: var(--poppins);
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 3px;
}
.db-recent-post__date {
  font-family: var(--poppins);
  font-size: 11px;
  color: var(--muted);
}

.db-topics { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Single post ── */
.db-post-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 32px 120px;
  animation: up .4s ease both;
}

.db-post__back {
  color: var(--muted);
  font-size: 14px;
  font-family: var(--poppins);
  margin-bottom: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
  text-decoration: none;
}
.db-post__back:hover { color: var(--accent); }

.db-post__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.db-post__title {
  font-family: var(--rubik);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: var(--heading);
  margin-bottom: 22px;
}

.db-post__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

/* ── Post content typography ── */
.db-post__content h1,
.db-post__content h2,
.db-post__content h3,
.db-post__content h4 {
  font-family: var(--rubik);
  color: var(--heading);
  margin: 40px 0 12px;
  letter-spacing: -0.4px;
  line-height: 1.25;
}
.db-post__content h1 { font-size: 28px; font-weight: 700; }
.db-post__content h2 { font-size: 22px; font-weight: 600; }
.db-post__content h3 { font-size: 18px; font-weight: 600; }
.db-post__content h4 { font-size: 16px; font-weight: 600; }

.db-post__content p {
  font-family: var(--poppins);
  color: var(--muted);
  line-height: 1.85;
  font-size: 17px;
  margin: 8px 0;
}
.db-post__content strong { color: var(--text); font-weight: 600; }
.db-post__content em { font-style: italic; }

.db-post__content a { color: var(--accent); }
.db-post__content a:hover { text-decoration: underline; }

.db-post__content ul,
.db-post__content ol {
  margin: 14px 0 14px 20px;
  line-height: 1.8;
}
.db-post__content li {
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--poppins);
  font-size: 16px;
}
.db-post__content li strong { color: var(--text); }

.db-post__content pre,
.db-post__content .highlight pre {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 20px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
  color: rgb(80,50,120);
}

.db-post__content .highlight {
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
}
.db-post__content .highlight .chroma { background: var(--bg) !important; }

.db-post__content code {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: .9em;
}

.db-post__content :not(pre) > code {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .85em;
}

.db-post__content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--muted);
  font-style: italic;
}

.db-post__content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}

.db-post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: var(--poppins);
  font-size: 14px;
}
.db-post__content th,
.db-post__content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.db-post__content th {
  background: var(--accent-light);
  color: var(--heading);
  font-weight: 600;
}

/* Post footer: tags */
.db-post__footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.db-post__footer-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* Comments section */
.db-comments { margin-top: 60px; }

/* ── Footer ── */
.db-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  text-align: center;
  font-family: var(--poppins);
  font-size: 13px;
  color: var(--muted);
}
.db-footer a { color: var(--accent); text-decoration: none; }
.db-footer a:hover { text-decoration: underline; }

/* ── List page ── */
.db-list-heading {
  margin-bottom: 32px;
  animation: up .4s ease both;
}
.db-list-heading h1 {
  font-family: var(--rubik);
  font-weight: 700;
  font-size: clamp(24px, 3.5vw, 36px);
  letter-spacing: -0.6px;
  color: var(--heading);
  margin-bottom: 6px;
}
.db-list-heading p {
  font-family: var(--poppins);
  font-size: 14px;
  color: var(--muted);
}

/* ── Pagination ── */
.db-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.db-pagination a,
.db-pagination span {
  font-family: var(--poppins);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
  display: inline-block;
}
.db-pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.db-pagination .db-pagination__active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .db-content-grid { grid-template-columns: 1fr; }
  .db-sidebar { display: none; }
  .db-hero__cols { grid-template-columns: 1fr; gap: 24px; }
  .db-hero__body { padding: 28px 24px; }
  .db-main { padding: 32px 20px 60px; }
  .db-nav__inner { padding: 0 20px; }
  .db-nav__links { display: none; }
}

@media (max-width: 600px) {
  .db-cards { grid-template-columns: 1fr; }
  .db-post-wrap { padding: 32px 16px 80px; }
  .db-footer { padding: 20px; }
}
