:root {
  --bg: #f7f8fa;
  --bg2: #eef0f3;
  --card: #ffffff;
  --stroke: #e2e6ec;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --text: #1c2330;
  --muted: #5d6673;
  --code-bg: #14161b;
  --navbar-bg: rgba(255, 255, 255, 0.88);
  --hover-bg: rgba(15, 23, 42, 0.06);
  --chip-bg: rgba(15, 23, 42, 0.05);
  --fcount-bg: rgba(15, 23, 42, 0.07);
  --num-ghost: rgba(15, 23, 42, 0.10);
  --soft-text: #4a5160;
  --code-text: #d6dae2;
  --cd-nums: #3d4451;
}

html[data-theme="dark"] {

  --bg: #121418;
  --bg2: #1a1d24;
  --card: #1e222b;
  --stroke: #2a2f3a;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --text: #eef0f4;
  --muted: #98a0ae;
  --code-bg: #14161b;
  --navbar-bg: rgba(18, 20, 24, 0.85);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --fcount-bg: rgba(255, 255, 255, 0.06);
  --num-ghost: rgba(255, 255, 255, 0.08);
  --soft-text: #c6ccd6;
  --code-text: #d6dae2;
  --cd-nums: #3d4451;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent2); }

.text-accent { color: var(--accent2); }
.text-muted { color: var(--muted); }
.bg-card { background: var(--card); }

.navbar {
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.navbar .navbar-brand .logo-mark {
  color: var(--accent2);
  font-weight: 900;
}
.navbar .nav-link {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--text);
  background: var(--hover-bg);
}
.navbar-toggler {
  border-color: var(--stroke);
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2398a0ae' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  border-radius: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.3s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

.search-toggle {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.375rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.search-toggle:hover,
.search-toggle.active {
  color: var(--text);
  background: var(--hover-bg);
}

.btn-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 40px;
  padding: 0.65rem 1.6rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-accent:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.35);
}
.btn-outline-ghost {
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 40px;
  font-weight: 600;
  padding: 0.65rem 1.6rem;
  transition: border-color 0.2s, transform 0.2s;
}
.btn-outline-ghost:hover {
  color: var(--text);
  border-color: var(--accent2);
  transform: translateY(-2px);
}
.btn-sm-ghost {
  border: 1px solid var(--stroke);
  color: var(--muted);
  border-radius: 40px;
  font-size: 0.85rem;
  padding: 0.35rem 1rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-sm-ghost:hover {
  color: var(--accent2);
  border-color: var(--accent2);
}

/* HERO */
.hero {
  padding: 84px 0 72px;
  background:
    radial-gradient(600px 340px at 80% 10%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(500px 300px at 10% 90%, rgba(59, 130, 246, 0.10), transparent 60%);
  border-bottom: 1px solid var(--stroke);
}
.hero .badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 40px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.15;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  color: var(--muted);
  max-width: 620px;
}
.hero .hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.hero .hero-stats .stat b {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent2);
  display: block;
}
.hero .hero-stats .stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* SECTIONS */
.section {
  padding: 72px 0;
}
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}
.section-head .kicker {
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}
.section-head h2 {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 8px 0 10px;
}
.section-head p { color: var(--muted); }

/* SERVICE CARDS */
.svc-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 26px;
  height: 100%;
  transition: transform 0.25s, border-color 0.25s;
}
.svc-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.svc-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.svc-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.svc-card h3 a { color: inherit; }
.svc-card h3 a:hover { color: var(--accent2); }
.svc-card p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.svc-card .comp-price {
  display: inline-block;
  margin-top: 10px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
  border-radius: 40px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.svc-card .comp-price {
  display: inline-block;
  margin-top: 10px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
  border-radius: 40px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.price-lg {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent2);
  margin: 6px 0 4px;
  line-height: 1.2;
}
.price-lg span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

/* PRICING CARD */
.price-card {
  border: 1px solid var(--stroke);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.07), var(--card) 42%);
  padding: 44px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}
.price-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 40px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.price-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.price-card .price-lg {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  margin: 8px 0 6px;
}
.price-card .price-lg span {
  font-size: 1.1rem;
  font-weight: 600;
}
.price-card .price-sub {
  color: var(--muted);
  margin-top: 8px;
}
.price-card .price-list {
  list-style: none;
  padding: 0;
  margin: 28px auto 0;
  max-width: 680px;
  text-align: left;
}
.price-card .price-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-top: 1px solid var(--stroke);
  color: var(--soft-text);
  font-size: 0.98rem;
}
.price-card .price-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--accent2);
  font-weight: 800;
}
.price-card .price-cta {
  margin-top: 30px;
}

/* SKILLS */
.skill-row { margin-bottom: 20px; }
.skill-row .label {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.skill-row .label span:last-child { color: var(--muted); }
.progress {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 40px;
  height: 10px;
  overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 40px;
}

/* TECH STACK */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.tech-chip {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 40px;
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.tech-chip:hover {
  color: var(--accent2);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tech-chip b { color: var(--text); }

/* ARTICLE CARDS */
.post-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s, border-color 0.25s;
}
.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.post-card .thumb {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  background:
    radial-gradient(180px 120px at 50% 0%, rgba(59, 130, 246, 0.18), transparent 70%),
    var(--bg2);
}
.post-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.post-card .meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  align-items: center;
}
.post-card .meta .cat {
  color: var(--accent2);
  font-weight: 700;
}
.post-card h3 { font-size: 1.12rem; font-weight: 700; margin: 0; }
.post-card h3 a:hover { color: var(--accent2); }
.post-card p { color: var(--soft-text); font-size: 1rem; line-height: 1.65; margin: 0; flex: 1; }
.post-card .body img { max-height: 500px;
    object-fit: contain;
    max-width: 100%;
  height: auto;
}
.post-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-card .post-card-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  text-align: right;
}
.post-card .tags span {
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  border-radius: 40px;
  padding: 0.15rem 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* HOMEPAGE LATEST POSTS (unique) */
.home-post {
  position: relative;
  border: none;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home-post::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.home-post:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 46px rgba(59, 130, 246, 0.18);
}
.home-post .body {
  padding: 22px 22px 18px;
  gap: 12px;
}
.home-post .meta { align-items: center; }
.home-post .cat {
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
  border-radius: 40px;
  padding: 0.2rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.home-post h3 {
  font-size: 1.18rem;
  line-height: 1.3;
}
.home-post .post-card-foot {
  border-top: none;
  padding-top: 2px;
  text-align: left;
}
.home-post .post-card-foot .btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.home-post .post-card-foot .btn-accent .arrow {
  transition: transform 0.25s ease;
}
.home-post:hover .post-card-foot .btn-accent .arrow {
  transform: translateX(4px);
}

/* CTA BANNER */
.cta-banner {
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
}
.cta-banner h2 { font-size: 1.7rem; font-weight: 800; }
.cta-banner p { color: var(--muted); max-width: 520px; margin: 10px auto 24px; }

/* PRODUCT CARDS */
.product-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.14);
}
.product-card .thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.6rem;
  background:
    radial-gradient(180px 120px at 50% 0%, rgba(59, 130, 246, 0.18), transparent 70%),
    var(--bg2);
}
.product-card .body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.product-card .meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  align-items: center;
}
.product-card .meta .cat {
  color: var(--accent2);
  font-weight: 700;
}
.product-card h3 { font-size: 1.12rem; font-weight: 700; margin: 0; }
.product-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.product-card .product-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.product-card .price {
  display: flex;
  align-items: baseline;
}
.product-card .price .amount {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--fg);
}

/* CASE CARDS */
.case-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 26px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s, border-color 0.25s;
}
.case-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.case-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.case-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.case-card p { color: var(--muted); font-size: 0.9rem; margin: 0; flex: 1; }
.case-card .result { color: var(--accent2); font-weight: 700; font-size: 0.95rem; }
.case-card .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.case-card .tags span {
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  border-radius: 40px;
  padding: 0.15rem 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* PROCESS STEPS */
.step-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 26px;
  height: 100%;
  position: relative;
  transition: transform 0.25s, border-color 0.25s;
}
.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.step-card .num {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--num-ghost);
  line-height: 1;
}
.step-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.step-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* TESTIMONIALS */
.testi-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 26px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s, border-color 0.25s;
}
.testi-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.testi-card .stars { color: var(--accent2); letter-spacing: 2px; }
.testi-card .quote { color: var(--soft-text); font-size: 0.95rem; flex: 1; margin: 0; }
.testi-card .author { display: flex; align-items: center; gap: 12px; }
.testi-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.testi-card .author b { display: block; font-size: 0.95rem; }
.testi-card .author span { color: var(--muted); font-size: 0.82rem; }

/* TESTIMONIALS CAROUSEL */
#testiCarousel { width: 100%; margin: 0 auto; }
#testiCarousel .carousel-item { padding: 4px; }
#testiCarousel .testi-card { height: 100%; }
#testiCarousel .carousel-indicators {
  position: static;
  margin-top: 30px;
  margin-bottom: 0;
}
#testiCarousel .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  border: none;
  background-color: var(--muted);
  opacity: 0.4;
  transition: opacity 0.2s, background-color 0.2s;
}
#testiCarousel .carousel-indicators .active {
  background-color: var(--accent2);
  opacity: 1;
}

/* FAQ */
.faq-acc .accordion-item {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px !important;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-acc .accordion-button {
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  padding: 18px 20px;
  box-shadow: none;
}
.faq-acc .accordion-button:not(.collapsed) {
  background: var(--bg2);
  color: var(--accent2);
}
.faq-acc .accordion-button:focus {
  box-shadow: none;
  border-color: var(--stroke);
}
.faq-acc .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2398a0ae'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.faq-acc .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%233b82f6'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.faq-acc .accordion-body {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0 20px 18px;
  border-top: 1px solid var(--stroke);
}

/* FOOTER */
footer {
  margin-top: auto;
  border-top: 1px solid var(--stroke);
  background: var(--bg2);
  padding: 36px 0 28px;
}
footer .brand { font-weight: 800; font-size: 1.1rem; }
footer .brand .logo-mark { color: var(--accent2); font-weight: 900; }
footer .foot-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
}
footer .foot-col ul { list-style: none; padding: 0; margin: 0; }
footer .foot-col li { margin-bottom: 8px; }
footer .foot-col a { color: var(--muted); font-size: 0.92rem; }
footer .foot-col a:hover { color: var(--accent2); }
footer .foot-bottom {
  border-top: 1px solid var(--stroke);
  margin-top: 28px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}
html[data-theme="dark"] footer,
html[data-theme="dark"] footer .foot-col h4,
html[data-theme="dark"] footer .foot-col a,
html[data-theme="dark"] footer .foot-bottom {
  color: var(--soft-text);
}
html[data-theme="dark"] footer .text-muted {
  color: var(--soft-text) !important;
}

/* PAGE HEAD */
.page-head {
  padding: 64px 0 36px;
  background:
    radial-gradient(500px 220px at 70% 0%, rgba(59, 130, 246, 0.14), transparent 60%);
  border-bottom: 1px solid var(--stroke);
}
.page-head .kicker {
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
}
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; }
.page-head p { color: var(--muted); }

/* BLOG SIDEBAR FILTER */
.blog-sidebar {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  position: sticky;
  top: 88px;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.side-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}
.side-count {
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 40px;
  padding: 0.1rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.blog-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.blog-filter .fbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--stroke);
  color: var(--muted);
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.blog-filter .fbtn .ficon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.blog-filter .fbtn .flabel { flex: 1; }
.blog-filter .fbtn .fcount {
  background: var(--fcount-bg);
  border-radius: 40px;
  padding: 0.05rem 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.blog-filter .fbtn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateX(3px);
}
.blog-filter .fbtn.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
}
.blog-filter .fbtn.active .fcount {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* BLOG PAGINATION */
.pagination {
  margin-top: 36px;
  gap: 8px;
}
.pagination .page-item .page-link {
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--muted);
  border-radius: 10px !important;
  min-width: 42px;
  text-align: center;
  font-weight: 700;
  transition: all 0.2s;
  cursor: pointer;
}
.pagination .page-link:hover {
  color: var(--accent2);
  border-color: var(--accent);
}
.pagination .page-item.active .page-link {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--card);
  color: var(--muted);
}

/* CODE DEMO */
.code-copy-btn {
  float: right;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}
.code-copy-btn:hover {
  color: var(--accent2);
  border-color: var(--accent);
}
.code-copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}
.code-demo {
  background: var(--code-bg);
  border: 1px solid var(--stroke);
  border-radius: 0;
  overflow: hidden;
  margin: 24px 0;
}
.code-demo-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stroke);
  background: var(--bg2);
}
.cd-dots {
  display: flex;
  gap: 6px;
}
.cd-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.cd-dots .dot-red { background: #ff5f57; }
.cd-dots .dot-yellow { background: #febc2e; }
.cd-dots .dot-green { background: #28c840; }
.cd-name {
  flex: 1;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  padding-left: 4px;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 7px;
  color: var(--muted);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.copy-btn:hover {
  color: var(--accent2);
  border-color: var(--accent);
}
.copy-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
}
.code-demo-body {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}
.cd-nums {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  padding: 16px 12px;
  border-right: 1px solid var(--stroke);
  background: var(--code-bg);
  user-select: none;
}
.cd-nums span {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.53rem;
  color: var(--cd-nums);
}
.code-demo-body pre {
  flex: 1;
  margin: 0;
  padding: 16px 20px;
  background: var(--code-bg);
  overflow-x: auto;
}
.code-demo-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--code-text);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* HIGHLIGHT.JS */
.hljs {
  background: transparent;
  padding: 0;
  color: var(--code-text);
}
.code-demo-body code.hljs,
.article-body pre code.hljs {
  background: transparent;
  border: none;
  padding: 0;
}

/* BARE CODE BLOCK (blog cards) */
.post-card pre,
.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--stroke);
  border-radius: 0;
  margin: 24px 0;
  padding: 16px 20px;
  overflow-x: auto;
}
.post-card pre code,
.article-body pre code {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: var(--code-text);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ARTICLE PAGE */
.breadcrumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 22px; }
.breadcrumbs a:hover { color: var(--accent2); }
.article-head .cat { color: var(--accent2); font-weight: 700; font-size: 0.85rem; }
.article-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 900; }
.article-head .meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-body p a, .post-card p a {
   color: var(--accent2);
}

.article-body {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 36px;
}
.article-body h2 { font-size: 1.35rem; font-weight: 800; margin: 34px 0 12px; }
.article-body h3 { font-size: 1.12rem; font-weight: 700; margin: 26px 0 10px; }
.article-body p { color: var(--soft-text); margin-bottom: 14px; }
.article-body ul { padding-left: 1.2rem; margin-bottom: 14px; }
.article-body img {
    max-height: 500px;
    object-fit: contain;
    max-width: 100%;
    width: auto;
    height: auto;
}
.article-body li { color: var(--soft-text); margin-bottom: 6px; }
.article-body code,
.post-card code {
  background: var(--code-bg);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  color: var(--accent2);
  font-size: 0.9em;
}
.article-body .tip {
  background: rgba(59, 130, 246, 0.10);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  color: var(--soft-text);
  font-size: 0.95rem;
}
.article-body .tip b { color: var(--accent2); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.article-tags span {
  background: var(--chip-bg);
  border: 1px solid var(--stroke);
  border-radius: 40px;
  padding: 0.25rem 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.search-form {
  max-width: 640px;
  margin: 0 auto 32px;
}
.search-form .input-group .form-control {
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 0.8rem 1.5rem;
  font-size: 1.05rem;
}
.search-form .input-group .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.15);
}
.search-form .input-group .btn {
  border-radius: 40px;
  margin-left: 8px;
}
.sidebar-search {
  max-width: none;
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--stroke);
}
.sidebar-search .form-control {
  font-size: 0.8rem;
  height: 38px;
  padding: 0 0.8rem;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.sidebar-search .input-group .btn {
  border-radius: 0;
  margin-left: 5px;
  height: 38px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
  line-height: 1;
}
.search-meta {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
}
.search-examples {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -12px 0 28px;
}
.search-examples-label {
  color: var(--muted);
  font-size: 0.9rem;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  border-radius: 40px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.search-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.search-empty {
  color: var(--muted);
}

@media (max-width: 768px) {
  .hero { padding: 56px 0 48px; }
  .section { padding: 52px 0; }
  .article-body { padding: 24px; }
  .blog-sidebar { position: static; }
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-control::-webkit-input-placeholder {
  color: var(--soft-text);
  opacity: 1;
}