/* Theme: Microsoft Fluent-inspired.
   - Light surfaces, Segoe UI typography, Fluent shadows.
   - Microsoft logo palette (red / green / blue / yellow) used as accents. */

:root {
  /* Microsoft logo squares */
  --c-red:    #F25022;
  --c-green:  #7FBA00;
  --c-blue:   #00A4EF;
  --c-yellow: #FFB900;

  /* Fluent UI primary */
  --c-primary:        #0078D4;
  --c-primary-hover:  #106EBE;
  --c-primary-pressed:#005A9E;

  /* Surfaces */
  --bg:        #ffffff;
  --bg-soft:   #f5f7fa;
  --bg-card:   #ffffff;
  --border:    #e1e5ea;
  --border-strong: #c8cdd3;

  /* Text (Fluent neutrals) */
  --fg:      #201f1e;
  --fg-soft: #323130;
  --fg-dim:  #605e5c;

  /* Effects */
  --accent:   var(--c-primary);
  --accent-2: var(--c-blue);
  --max-width: 1120px;
  --radius: 8px;          /* Fluent uses smaller corner radii */
  --radius-lg: 12px;
  --shadow-sm: 0 0.3px 0.9px rgba(0,0,0,0.07), 0 1.6px 3.6px rgba(0,0,0,0.10);
  --shadow-md: 0 0.6px 1.8px rgba(0,0,0,0.08), 0 3.2px 7.2px rgba(0,0,0,0.13);
  --shadow-lg: 0 1.2px 3.6px rgba(0,0,0,0.10), 0 6.4px 14.4px rgba(0,0,0,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Segoe UI', 'Segoe UI Variable', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'Cascadia Code', 'Consolas', ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Top scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(
    90deg,
    var(--c-red) 0 25%,
    var(--c-green) 25% 50%,
    var(--c-blue) 50% 75%,
    var(--c-yellow) 75% 100%
  );
  transition: width 0.05s linear;
}

/* Brand stripe at top */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--c-red) 0 25%,
    var(--c-green) 25% 50%,
    var(--c-blue) 50% 75%,
    var(--c-yellow) 75% 100%
  );
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 26px; height: 26px;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.brand-mark i {
  display: block;
  width: 100%; height: 100%;
}
.brand-mark i:nth-child(1) { background: var(--c-red); }
.brand-mark i:nth-child(2) { background: var(--c-green); }
.brand-mark i:nth-child(3) { background: var(--c-blue); }
.brand-mark i:nth-child(4) { background: var(--c-yellow); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-name { font-weight: 600; color: var(--fg); }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  position: relative;
  color: var(--fg-soft);
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 0;
}
.site-nav a:not(.cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--c-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}
.site-nav a:not(.cta):hover { color: var(--c-primary); text-decoration: none; }
.site-nav a:not(.cta):hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--c-primary); }
.site-nav a.cta {
  color: #fff;
  background: var(--c-primary);
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.site-nav a.cta:hover { background: var(--c-primary-hover); text-decoration: none; }
.site-nav a.cta:active { background: var(--c-primary-pressed); }

@media (max-width: 720px) {
  .site-nav { gap: 12px; }
  .site-nav a:not(.cta) { display: none; }
}

/* Layout */
main { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
.section h2 {
  font-size: 1.85rem;
  margin: 0 0 16px;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.section h3 { color: var(--fg); }
.section-lead {
  color: var(--fg-dim);
  max-width: 760px;
  font-size: 1.02rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 110px 0 80px;
  overflow: hidden;
  background:
    radial-gradient(700px 360px at 12% 8%, rgba(0, 120, 212, 0.10), transparent 70%),
    radial-gradient(640px 320px at 92% 12%, rgba(0, 164, 239, 0.08), transparent 70%),
    radial-gradient(540px 320px at 60% 100%, rgba(127, 186, 0, 0.06), transparent 70%);
}
.hero-bg { display: none; }
.hero-layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1024px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 360px);
  }
}
.hero-inner {
  text-align: left;
  max-width: 760px;
}
.hero-sidebar { width: 100%; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-primary);
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
  color: var(--fg);
  font-weight: 700;
}
.accent {
  background: linear-gradient(90deg, var(--c-red) 0%, var(--c-green) 33%, var(--c-blue) 66%, var(--c-yellow) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.lead { font-size: 1.18rem; color: var(--fg); margin: 0 0 12px; font-weight: 500; }
.sublead { color: var(--fg-dim); margin: 0 0 28px; max-width: 760px; font-size: 1.02rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--c-primary-hover); box-shadow: var(--shadow-md); }
.btn-primary:active { background: var(--c-primary-pressed); }
.btn-ghost {
  color: var(--fg);
  border-color: var(--border-strong);
  background: #fff;
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.metric {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.metric::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.metric:nth-child(4n+1)::before { background: var(--c-red); }
.metric:nth-child(4n+2)::before { background: var(--c-green); }
.metric:nth-child(4n+3)::before { background: var(--c-blue); }
.metric:nth-child(4n+4)::before { background: var(--c-yellow); }
.metric-value {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.metric-label {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-top: 4px;
}

/* Section heads */
.section-head { margin-bottom: 24px; max-width: 760px; }
.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-primary);
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* Achievements */
.achievements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.achievements li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--fg);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.achievements li:hover {
  border-color: var(--c-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.achievements .check {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  height: 22px; width: 22px;
  border-radius: 999px;
  background: var(--c-green);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}

/* Grids and cards */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h3 { margin: 0 0 10px; font-size: 1.05rem; color: var(--fg); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 120, 212, 0.08);
  color: var(--c-primary);
  border: 1px solid rgba(0, 120, 212, 0.25);
  font-weight: 600;
}

/* Leadership cards: cycle through Microsoft logo colors on the left edge */
.lead-card { position: relative; padding-left: 26px; }
.lead-card::before {
  content: "";
  position: absolute; left: 14px; top: 22px; bottom: 22px;
  width: 3px; border-radius: 2px;
}
.grid > .lead-card:nth-child(6n+1)::before { background: var(--c-red); }
.grid > .lead-card:nth-child(6n+2)::before { background: var(--c-green); }
.grid > .lead-card:nth-child(6n+3)::before { background: var(--c-blue); }
.grid > .lead-card:nth-child(6n+4)::before { background: var(--c-yellow); }
.grid > .lead-card:nth-child(6n+5)::before { background: var(--c-primary); }
.grid > .lead-card:nth-child(6n+6)::before { background: var(--c-red); }
.lead-card p { margin: 0; color: var(--fg-dim); }

/* Tag lists */
.tag-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tag-list li {
  font-size: 0.82rem;
  color: var(--fg-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-list.compact li { font-size: 0.78rem; }

.bullets { padding-left: 18px; color: var(--fg-soft); }
.bullets li { margin: 6px 0; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: none; }
.timeline-meta { color: var(--fg-dim); font-size: 0.92rem; }
.company { display: block; color: var(--fg); font-weight: 700; font-size: 1rem; }
.period { font-size: 0.85rem; }
.timeline-body h3 { margin: 0 0 8px; font-size: 1.05rem; }
.timeline-body ul { padding-left: 18px; margin: 0; color: var(--fg-soft); }
.timeline-body li { margin: 6px 0; }

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

/* Contact card */
.section-contact { text-align: center; }
.contact-card {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--c-red) 0 25%,
    var(--c-green) 25% 50%,
    var(--c-blue) 50% 75%,
    var(--c-yellow) 75% 100%
  );
}
.contact-card h2 { margin-top: 0; }
.contact-email {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 16px 0 8px;
  word-break: break-all;
}
.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}
.contact-meta { color: var(--fg-dim); font-size: 0.92rem; margin: 0; }

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 48px;
  color: var(--fg-dim);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}
.footer-links a { color: var(--fg-soft); }
.footer-links span { color: var(--border-strong); margin: 0 6px; }

/* Chat */
.chat {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: 600px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chat-log {
  padding: 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 360px;
  background: var(--bg-soft);
}
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}
.msg-bot {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--fg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-user {
  background: var(--c-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-suggestions button {
  background: #fff;
  color: var(--fg-soft);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chat-suggestions button:hover {
  background: rgba(0, 120, 212, 0.08);
  color: var(--c-primary);
  border-color: var(--c-primary);
}

.chat-form {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-form input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-family: inherit;
}
.chat-form input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.18);
}

.msg-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.msg-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}
.msg-typing span:nth-child(1) { background: var(--c-red); }
.msg-typing span:nth-child(2) { background: var(--c-green); animation-delay: 0.15s; }
.msg-typing span:nth-child(3) { background: var(--c-blue); animation-delay: 0.3s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}

/* Callout */
.callout {
  background: #fff8e1;
  border: 1px solid #f9d77a;
  color: #6b4d00;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  margin: 0 0 16px;
}
.callout code {
  background: #fff;
  border: 1px solid #f1e0ad;
}


/* ===== Interactivity ===== */

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .accent { animation: none; }
}

/* Subtle 3D card tilt */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tilt:hover { box-shadow: var(--shadow-lg); }

/* Floating chat launcher (Fluent FAB) */
.fab-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(0, 120, 212, 0.35);
  transition: transform 0.18s ease, background 0.15s ease, box-shadow 0.18s ease;
}
.fab-chat:hover {
  background: var(--c-primary-hover);
  transform: translateY(-2px);
  text-decoration: none;
}
.fab-chat svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .fab-chat span { display: none; }
  .fab-chat { padding: 14px; }
}

/* Back-to-top */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 49;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--c-primary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
}
.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover { background: var(--bg-soft); text-decoration: none; }

/* Keyboard shortcut hint chip */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-left: 8px;
}
.kbd {
  font-family: 'Cascadia Code', 'Consolas', ui-monospace, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
  color: var(--fg-soft);
}

/* Region badge in footer (DR validation aid) */
.region-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.25);
  color: var(--c-primary, #0078D4);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.region-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7FBA00;
  box-shadow: 0 0 0 3px rgba(127, 186, 0, 0.18);
  animation: region-pulse 2.4s ease-in-out infinite;
}
@keyframes region-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(127, 186, 0, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(127, 186, 0, 0.04); }
}
@media (prefers-reduced-motion: reduce) {
  .region-dot { animation: none; }
}

/* ===========================================================
   Blog: home-page sidebar, listing grid, single-post layout
   =========================================================== */

/* Home page: 2-col layout for Achievements + Latest writing */
.achievements-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 980px) {
  .achievements-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    align-items: start;
  }
}

.home-sidebar { position: sticky; top: 88px; }

.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.sidebar-head { margin-bottom: 14px; }
.sidebar-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fg);
}

/* Compact post list (used in home sidebar + post sidebar) */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.post-list li { margin: 0; }
.post-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.post-list a:hover {
  background: var(--bg-soft);
  border-color: var(--border);
}
.post-list-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--fg);
}
.post-list-date {
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}
.post-list-footer {
  margin: 14px 0 0;
  text-align: right;
  font-size: 0.9rem;
}

/* Blog index grid */
.post-grid {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.post-grid li { margin: 0; }
.post-card h3 a {
  color: var(--fg);
  text-decoration: none;
}
.post-card h3 a:hover { color: var(--c-primary); }
.post-tags {
  margin: 10px 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.post-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.06);
  color: var(--c-primary);
  border: 1px solid rgba(0, 120, 212, 0.18);
  letter-spacing: 0.02em;
}
.post-readmore { margin: 8px 0 0; font-size: 0.92rem; }

/* Single post (article) layout: article + sidebar */
.blog-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 980px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: start;
  }
}
.blog-sidebar { position: sticky; top: 88px; }
.blog-sidebar h3 { margin: 0 0 12px; font-size: 1rem; color: var(--fg); }

.post {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
}
.post-head { margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.post-head h1 { margin: 6px 0 10px; font-size: 1.7rem; line-height: 1.25; }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.post-meta time { font-weight: 600; color: var(--fg); }

.post-body { color: var(--fg); line-height: 1.65; font-size: 1rem; }
.post-body h3 { margin: 28px 0 8px; color: var(--fg); font-size: 1.1rem; }
.post-body p { margin: 12px 0; }
.post-body ul, .post-body ol { margin: 12px 0; padding-left: 26px; }
.post-body li { margin: 4px 0; }
.post-body code {
  background: rgba(0, 120, 212, 0.07);
  border: 1px solid rgba(0, 120, 212, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--c-primary-pressed);
}
.post-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 16px 0;
}
.post-body pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}
.post-body blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--c-primary);
  background: rgba(0, 120, 212, 0.04);
  color: var(--fg);
  font-style: italic;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}
.post-body th, .post-body td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.post-body th {
  background: var(--bg-soft);
  font-weight: 600;
}

.post-foot {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

