*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #f5f1ea;
  color: #1a1612;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { cursor: pointer; }

:root {
  --accent:      #b8542a;
  --accent-soft: #e8d5b7;
  --bg:          #f5f1ea;
  --bg-alt:      #ebe4d6;
  --ink:         #1a1612;
  --ink-soft:    #3a342c;
  --muted:       #5e574e;
  --line:        #d9cfbe;
  --white:       #ffffff;
  --sx:          clamp(20px, 6vw, 64px);
}

.mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  letter-spacing: -0.025em;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,241,234,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px var(--sx);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-logo { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.nav-logo-mark img { height: 34px; width: auto; }
.nav-logo-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links {
  display: flex;
  gap: 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-links a { color: inherit; text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); font-weight: 500; }
.nav-cta {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 10px 18px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .2s;
}
.nav-cta:hover { background: var(--accent); }
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 63px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 20px var(--sx);
  flex-direction: column;
  gap: 14px;
  z-index: 49;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.mobile-menu .menu-wa { color: var(--accent); font-weight: 600; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── Blog Hero (Index) ── */
.blog-hero {
  padding: 64px var(--sx) 48px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.blog-hero-inner { max-width: 1180px; margin: 0 auto; }
.blog-eyebrow {
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.blog-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  max-width: 860px;
}
.blog-hero h1 em { font-style: italic; color: var(--accent); }
.blog-hero-sub {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 680px;
  margin: 0 0 28px;
}
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ── Container & Cards ── */
.blog-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px var(--sx) 80px;
}
.section-label {
  color: var(--muted);
  margin-bottom: 18px;
  display: block;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 48px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(26,22,18,.08);
}
.featured-img-wrap {
  position: relative;
  min-height: 320px;
  background: var(--bg-alt);
}
.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(26,22,18,.88);
  color: var(--bg);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.featured-body {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.post-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.featured-body h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.18;
  margin: 0 0 14px;
}
.featured-body h2 a, .post-card h3 a {
  color: var(--ink);
  text-decoration: none;
  transition: color .2s;
}
.featured-body h2 a:hover, .post-card h3 a:hover { color: var(--accent); }
.post-excerpt {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 24px;
}
.card-footer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.author-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.author-mini img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.read-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.read-link:hover { text-decoration: underline; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.post-card {
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .25s, box-shadow .25s;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26,22,18,.07);
}
.post-card-img {
  position: relative;
  height: 220px;
  background: var(--bg-alt);
  overflow: hidden;
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-body { padding: 24px; flex-grow: 1; }
.post-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.24;
  margin: 0 0 10px;
}
.post-card .card-footer { padding: 16px 24px 20px; }

/* ── Article Page ── */
.article-header {
  padding: 48px var(--sx) 40px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.article-header-inner { max-width: 820px; margin: 0 auto; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.article-header h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 14px 0 22px;
}
.article-author-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.article-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-author-info img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.article-author-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.article-author-role { font-size: 12px; color: var(--muted); }

.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px var(--sx) 80px;
}
.article-hero-figure {
  margin: 0 0 36px;
  background: var(--white);
  border: 1px solid var(--line);
}
.article-hero-figure img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}
.article-hero-figure figcaption {
  padding: 12px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.article-content {
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 48px);
}
.article-content .lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.article-content h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  color: var(--ink);
  margin: 40px 0 14px;
}
.article-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 10px;
}
.article-content p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.article-content ul, .article-content ol {
  margin: 0 0 22px;
  padding-left: 22px;
  color: var(--ink-soft);
}
.article-content li { margin-bottom: 10px; font-size: 15.5px; }

.nbr-callout {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--bg);
  border-left: 4px solid var(--accent);
}
.nbr-callout-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.nbr-callout p { margin: 0; font-size: 14.5px; color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 24px 0 28px; }
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.tech-table th {
  background: var(--bg-alt);
  color: var(--ink);
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid var(--line);
}
.tech-table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.tech-table tr:nth-child(even) td { background: rgba(245,241,234,.4); }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.tag-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 5px 10px;
}

.cta-banner {
  margin-top: 40px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--ink);
  color: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cta-banner h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 8px;
  color: var(--bg);
}
.cta-banner p {
  margin: 0;
  font-size: 14px;
  color: rgba(245,241,234,.78);
  max-width: 520px;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--white) !important;
  padding: 14px 24px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity .2s;
  white-space: nowrap;
}
.cta-btn:hover { opacity: 0.92; }

.author-box {
  margin-top: 36px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  display: flex;
  gap: 18px;
  align-items: center;
}
.author-box img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.author-box h4 { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.author-box p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

.related-section { margin-top: 48px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.related-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .2s;
}
.related-card:hover { border-color: var(--accent); }
.related-card h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 19px;
  line-height: 1.25;
  margin: 8px 0 10px;
  color: var(--ink);
}
.related-card p { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

/* ── Footer & WhatsApp FAB ── */
footer {
  padding: 32px var(--sx);
  background: var(--ink);
  color: rgba(245,241,234,.58);
  border-top: 1px solid rgba(245,241,234,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wa-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  z-index: 60;
  transition: transform .2s;
}
.wa-fab:hover { transform: scale(1.06); }

/* ── Interactive Sketchfab 3D Embed in Articles ── */
.model3d-container {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1612;
  overflow: hidden;
  cursor: pointer;
}
.model3d-container img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  display: block;
}
.model3d-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 18, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background .2s;
}
.model3d-container:hover .model3d-overlay { background: rgba(26, 22, 18, 0.22); }
.model3d-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  border-radius: 30px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform .2s;
}
.model3d-container:hover .model3d-btn { transform: scale(1.03); }
.model3d-hint {
  color: #fff;
  font-size: 11px;
  margin-top: 8px;
  opacity: 0.92;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

@media (max-width: 820px) {
  .nav-links, .nav-cta { display: none !important; }
  .nav-burger { display: flex !important; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-img-wrap { min-height: 220px; }
  .author-box { flex-direction: column; text-align: center; }
}
