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

:root {
  --ink: #0e0e0e;
  --ink-muted: #555;
  --ink-faint: #999;
  --paper: #faf9f6;
  --paper-alt: #f3f1ec;
  --accent: #1a56e8;
  --blue-600: #2563eb;
  --accent-soft: #fbeae9;
  --accent2: #1a56e8;
  --rule: #e2dfd8;
  --card-bg: #ffffff;
  --tag-bg: #f0ede7;
  --radius: 4px;
  --radius-lg: 12px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-hover:
    0 12px 40px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.06);
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --nav-h: 68px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── PAGE HERO ── */
.page-hero {
  border-bottom: 1px solid var(--rule);
  padding: 40px;
  background: linear-gradient(160deg, var(--paper) 0%, var(--paper-alt) 100%);
  position: relative;
  overflow: hidden;
  margin-top: 70px;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(
    circle,
    rgba(214, 60, 47, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -1px;
  color: var(--ink);
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-desc {
  font-size: 16px;
  color: var(--ink-muted);
  max-width: 480px;
  line-height: 1.7;
  margin-top: 16px;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: right;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
  display: block;
}

.stat-lbl {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ── FILTER BAR ── */
.filter-bar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-inner::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 16px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.filter-btn:hover {
  color: var(--ink);
}

.filter-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.filter-btn .lucide {
  width: 14px;
  height: 14px;
}

/* ── MAIN CONTENT ── */
.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Featured post — spans full width */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  margin-bottom: 56px;
  transition:
    box-shadow 0.3s,
    transform 0.3s;
  text-decoration: none;
  color: inherit;
}

.featured-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.featured-img-wrap {
  position: relative;
  overflow: hidden;
  min-height: 360px;
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.featured-card:hover .featured-img-wrap img {
  transform: scale(1.04);
}

.featured-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
}

.featured-body {
  padding: 48px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.post-category .lucide {
  width: 13px;
  height: 13px;
}

.featured-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 16px;
}

.featured-excerpt {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-faint);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-item .lucide {
  width: 13px;
  height: 13px;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  margin-top: 24px;
  align-self: flex-start;
  transition:
    background 0.2s,
    gap 0.2s;
}

.read-link:hover {
  background: var(--accent);
  gap: 12px;
}

.read-link .lucide {
  width: 15px;
  height: 15px;
}

/* ── GRID POSTS ── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    box-shadow 0.3s,
    transform 0.3s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-img-wrap {
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .card-img-wrap img {
  transform: scale(1.06);
}

/* Placeholder when no image */
.card-img-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  width: fit-content;
}

.card-tag .lucide {
  width: 11px;
  height: 11px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 12px;
}

.card-excerpt {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-faint);
}

.card-meta .lucide {
  width: 12px;
  height: 12px;
}

.card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

.post-card:hover .card-arrow {
  background: var(--accent);
  color: #fff;
  transform: translateX(2px);
}

.card-arrow .lucide {
  width: 14px;
  height: 14px;
}

/* ── NO RESULTS ── */
.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-muted);
}

.no-results .lucide {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.no-results p {
  font-size: 16px;
}

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  transition-delay: calc(var(--i) * 80ms);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .hero-visual {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  #hero {
    padding: 100px 20px 60px;
  }

  .container {
    padding: 0 20px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }
}

/* ── ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  transition-delay: calc(var(--i) * 80ms);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 768px) {
  #hero {
    padding: 100px 20px 60px;
  }

  .container {
    padding: 0 20px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.anim-d1 {
  animation-delay: 0.05s;
}

.anim-d2 {
  animation-delay: 0.12s;
}

.anim-d3 {
  animation-delay: 0.18s;
}

.anim-d4 {
  animation-delay: 0.24s;
}

/* ── MOBILE NAV OVERLAY ── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  flex-direction: column;
  padding: 80px 24px 24px;
  gap: 8px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-img-wrap {
    min-height: 240px;
  }

  .featured-body {
    padding: 28px 28px 24px;
  }

  .hero-stat {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .featured-body {
    padding: 20px 20px 18px;
  }

  .page-hero {
    padding: 40px 20px 32px;
  }
}
