/* =====================================================
   MANAV.ID BLOG — pastel light theme
   Editorial typography. Long-form serif body. No bold.
   Generous whitespace. Mobile-first. Restrained sizes.
   ===================================================== */

:root {
  /* Surfaces — warm pastel palette */
  --bg: #fbfaf6;
  --s1: #ffffff;
  --s2: #f4f1ec;
  --s3: #ebe6db;
  --bdr: #e2dccf;

  /* Text — dark on light */
  --tx: #1f1d2c;
  --tx2: #51536a;
  --tx3: #8b8e9f;

  /* Accents (used for color, never for weight) */
  --ac:  #8b7df5;
  --ac2: #6e5cf7;
  --grn: #7ccfa0;
  --grn2:#3da76d;
  --red: #f29090;
  --red2:#c94f4f;
  --org: #fbbf77;
  --org2:#c97b1a;
  --blu: #8dbaf5;
  --blu2:#2f6bc8;
  --pk:  #f0a9ce;
  --tl:  #85d7d1;
  --gld: #e7b750;
  --gld2:#8a6a1f;

  /* Layout */
  --maxw: 700px;
  --maxw-wide: 1100px;
  --radius: 12px;
  --radius-pill: 999px;

  /* Type scale — restrained, editorial, no big fonts */
  --fs-1: 34px;
  --fs-2: 26px;
  --fs-3: 22px;
  --fs-4: 19px;
  --fs-body: 17px;
  --fs-meta: 14px;
  --fs-small: 13px;

  /* Font stacks — long-form editorial typography */
  --font-serif: 'Charter', 'Iowan Old Style', 'Source Serif Pro', 'Apple Garamond',
                Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

@media (min-width: 720px) {
  :root {
    --fs-1: 40px;
    --fs-2: 30px;
    --fs-3: 23px;
    --fs-4: 20px;
    --fs-body: 18px;
    --fs-meta: 15px;
  }
}

@media (min-width: 1100px) {
  :root {
    --fs-1: 44px;
    --fs-2: 32px;
    --fs-body: 19px;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* GLOBAL — kill all bold. */
b, strong {
  font-weight: 400 !important;
  color: var(--ac2);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.2;
  color: var(--tx);
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,250,246,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--bdr);
}
.topbar-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--tx);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .dot {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: url('../images/manav_id_sq.png') center/contain no-repeat;
}
.nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-sans);
}
.nav a {
  color: var(--tx2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color .18s ease;
}
.nav a:hover, .nav a.active { color: var(--ac2); }

/* ===== Text loader — animated [^_^] face =====
   Pure CSS, no GIF. Crisp at any size, inherits color.
   Use: <span class="loader"></span>  or  <span class="loader loader-think"></span>
   Pair with brand: <span class="brand-loader"></span>Manav.id
*/
.loader,
.loader-think,
.brand-loader {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  white-space: pre;
  color: inherit;
}
.loader::before {
  content: "[^_^]";
  animation: manav-blink 2.4s steps(1) infinite;
}
.loader-think::before {
  content: "[^_^]";
  animation: manav-think 1.6s steps(1) infinite;
}
.brand-loader::before {
  content: "[^_^]";
  animation: manav-think 1.6s steps(1) infinite;
}

/* Natural blink: open, open, open, blink, open. Returns home. */
@keyframes manav-blink {
   0%   { content: "[^_^]"; }
  82%   { content: "[-_-]"; }
  86%   { content: "[-_^]"; }
  90%   { content: "[^_^]"; }
}

/* Thinking / sparkle: your sequence, looped back to happy.
   Dropped [^_x] (reads as "dead" — wrong signal for loading). */
@keyframes manav-think {
   0%  { content: "[^_^]"; }
  20%  { content: "[^_-]"; }
  40%  { content: "[^_+]"; }
  60%  { content: "[^_*]"; }
  80%  { content: "[^_^]"; }
}

/* Reduced motion: hold the happy face, no animation */
@media (prefers-reduced-motion: reduce) {
  .loader::before, .loader-think::before, .brand-loader::before {
    animation: none;
    content: "[^_^]";
  }
}

/* ===== Containers ===== */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 22px 96px;
}
.container-wide {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 48px 22px 96px;
}
@media (min-width: 720px) {
  .container { padding: 80px 32px 120px; }
  .container-wide { padding: 64px 32px 120px; }
}

/* ===== Hero ===== */
.hero { margin-bottom: 56px; }
.hero h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-1);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
  color: var(--tx);
}
.hero p.lede {
  font-family: var(--font-serif);
  font-size: calc(var(--fs-body) + 2px);
  line-height: 1.65;
  color: var(--tx2);
  font-weight: 400;
  max-width: 620px;
  font-style: italic;
}

/* ===== Article hero image ===== */
.article-hero {
  width: 100%;
  aspect-ratio: 5 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
  background: var(--s2);
  border: 1px solid var(--bdr);
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Article body ===== */
article.post {
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.78;
  color: var(--tx);
  font-weight: 400;
}
article.post .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: var(--fs-meta);
  color: var(--tx3);
  margin-bottom: 28px;
  font-weight: 400;
}
article.post .meta .pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--s2);
  border: 1px solid var(--bdr);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
article.post h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-2);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin-bottom: 28px;
  color: var(--tx);
}
article.post h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-3);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 56px 0 18px;
  color: var(--tx);
}
article.post h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-4);
  font-weight: 500;
  line-height: 1.35;
  margin: 36px 0 12px;
  color: var(--tx);
}
article.post p { margin-bottom: 24px; color: var(--tx); }
article.post p.lede {
  font-family: var(--font-serif);
  font-size: calc(var(--fs-body) + 3px);
  line-height: 1.6;
  color: var(--tx2);
  font-style: italic;
  font-weight: 400;
  margin-bottom: 40px;
  letter-spacing: -0.005em;
}
article.post ul, article.post ol { margin: 0 0 28px 24px; padding-left: 6px; }
article.post li { margin-bottom: 10px; color: var(--tx); line-height: 1.72; }
article.post a {
  color: var(--ac2);
  text-decoration: none;
  border-bottom: 1px solid rgba(110,92,247,0.28);
  transition: border-color .18s ease;
}
article.post a:hover { border-bottom-color: var(--ac2); }
article.post blockquote {
  border-left: 3px solid var(--ac);
  background: var(--s2);
  padding: 22px 26px;
  border-radius: var(--radius);
  margin: 32px 0;
  font-family: var(--font-serif);
  font-size: calc(var(--fs-body) + 1px);
  color: var(--tx);
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
}
article.post code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--s3);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--ac2);
  font-weight: 400;
}
article.post pre {
  background: var(--s2);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  margin: 28px 0;
}
article.post pre code { background: transparent; padding: 0; color: var(--tx); }
article.post table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--s1);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--bdr);
  display: block;
  overflow-x: auto;
}
@media (min-width: 720px) {
  article.post table { display: table; font-size: 15px; }
}
article.post th {
  background: var(--s2);
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--tx);
  border-bottom: 1px solid var(--bdr);
  letter-spacing: 0.01em;
}
article.post td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bdr);
  color: var(--tx);
  font-weight: 400;
}
article.post tr:last-child td { border-bottom: none; }
article.post hr { border: none; height: 1px; background: var(--bdr); margin: 48px 0; }

.callout {
  background: var(--s2);
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--ac);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 28px 0;
  color: var(--tx);
  font-size: var(--fs-body);
  line-height: 1.7;
}

/* ===== Blog landing — search + list ===== */
.search-wrap { position: relative; margin: 0 0 32px; max-width: 720px; }
.search-wrap input {
  width: 100%;
  padding: 18px 22px 18px 50px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--tx);
  background: var(--s1);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-wrap input::placeholder { color: var(--tx3); font-style: italic; }
.search-wrap input:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 4px rgba(139,125,245,0.12);
}
.search-wrap .icon {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--tx3);
  pointer-events: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
  font-family: var(--font-sans);
}
.filter {
  padding: 9px 16px;
  background: var(--s1);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  color: var(--tx2);
  font-weight: 400;
  transition: all .18s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.filter:hover { background: var(--s2); border-color: var(--ac); color: var(--ac2); }
.filter.active {
  background: var(--ac2);
  color: white;
  border-color: var(--ac2);
}

.results-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--tx3);
  margin-bottom: 24px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.posts-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 720px) {
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.post-card {
  background: var(--s1);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(31,29,44,0.08);
  border-color: var(--ac);
}
.post-card .thumb {
  width: 100%;
  aspect-ratio: 5 / 3;
  background: var(--s2);
  border-bottom: 1px solid var(--bdr);
  position: relative;
  overflow: hidden;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .thumb .cat {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ac2);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.post-card .body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.post-card h3 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.012em;
  color: var(--tx);
  margin: 0;
}
.post-card p {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--tx2);
  margin: 0;
  font-weight: 400;
}
.post-card .meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--tx3);
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ===== CTA / inline ===== */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; font-family: var(--font-sans); }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: all .18s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn.primary {
  background: var(--ac2);
  color: white;
  box-shadow: 0 4px 16px rgba(139,125,245,0.22);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(139,125,245,0.30); background: var(--ac); }
.btn.ghost { background: var(--s1); color: var(--tx); border-color: var(--bdr); }
.btn.ghost:hover { border-color: var(--ac); color: var(--ac2); }

/* ===== Footer ===== */
footer.site {
  border-top: 1px solid var(--bdr);
  background: rgba(255,255,255,0.5);
  padding: 48px 22px;
  margin-top: 80px;
  font-family: var(--font-sans);
}
footer.site .inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
footer.site p { font-size: 14px; color: var(--tx2); font-weight: 400; }
footer.site a {
  color: var(--tx2);
  text-decoration: none;
  margin: 0 10px;
  font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: border-color .18s ease, color .18s ease;
  font-weight: 400;
}
footer.site a:hover { color: var(--ac2); border-bottom-color: var(--ac2); }

/* ===== Related posts ===== */
.related { margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--bdr); }
.related h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-3);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
  color: var(--tx);
}
.related .list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) {
  .related .list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}
.related .item {
  padding: 18px 20px;
  background: var(--s1);
  border: 1px solid var(--bdr);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, transform .18s ease;
  display: block;
}
.related .item:hover { border-color: var(--ac); transform: translateY(-2px); }
.related .item .cat {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ac2);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.related .item h4 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--tx);
}

@media (max-width: 480px) {
  .nav .hide-sm { display: none; }
}
