/* ==========================================================================
   Tam Nguyen — Personal Tech Blog
   Design tokens + layout. Dark mode first, light mode supported.
   ========================================================================== */

:root {
  --bg: #0d1117;
  --bg-soft: #131a23;
  --bg-card: #161d27;
  --border: #232c39;
  --text: #e6edf3;
  --text-muted: #9aa7b6;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-2: #22d3ee;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --maxw: 1140px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-card: #ffffff;
  --border: #e3e8ef;
  --text: #0f172a;
  --text-muted: #5b6878;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* Translate widget and Google banner are driven by the custom language button. */
html,
body { top: 0 !important; margin-top: 0 !important; }
.google-translate-host,
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.goog-te-balloon-frame,
.goog-te-menu-frame,
.goog-te-gadget,
.goog-tooltip,
#goog-gt-tt,
#google_translate_element { display: none !important; height: 0 !important; }
body > .skiptranslate,
body > iframe.skiptranslate,
body > div[id^="goog-"] { display: none !important; height: 0 !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: 0.18s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.language-toggle {
  height: 36px;
  min-width: 48px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.18s;
}
.language-toggle:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

.nav-toggle { display: none; }

.search-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.site-search {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 100;
}

.site-search[hidden] { display: none !important; }
.site-search:not([hidden]) { display: block; }

.site-search-form,
.search-page-form {
  display: flex;
  gap: 10px;
}

.site-search-form { max-width: var(--maxw); margin: 0 auto; }

.site-search-form input,
.search-page-form input {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.site-search-form input:focus,
.search-page-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-page { min-height: 60vh; }
.search-page-head { margin-bottom: 28px; }
.search-page-head .eyebrow { margin-bottom: 12px; }
.search-page-head h1 { margin: 0; font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.03em; }
.search-page-head p { margin: 8px 0 0; color: var(--text-muted); }
.search-page-form { max-width: 760px; }
.search-status { margin: 24px 0 14px; color: var(--text-muted); font-size: 14px; }
.search-results { display: grid; gap: 12px; max-width: 900px; }
.search-result {
  display: block;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.18s, transform 0.18s;
}
.search-result:hover { border-color: var(--accent); transform: translateY(-2px); }
.search-result-type { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.search-result h2 { margin: 4px 0 6px; font-size: 18px; line-height: 1.4; }
.search-result p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.search-result mark { color: var(--text); background: var(--accent-soft); border-radius: 3px; }

/* ------------------------------------------------------------------ Hero */
.hero {
  padding: 84px 0 64px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 400px at 80% -10%, var(--accent-soft), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  max-width: 17ch;
  font-size: clamp(36px, 4.4vw, 48px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 750;
}

.hero h1 span { color: var(--accent); }

.hero p.lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 28px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-ghost { border-color: var(--border); color: var(--text); background: var(--bg-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-card .avatar {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 22px;
}
.hero-card .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 53% 34%; transform: scale(2.2); transform-origin: 53% 34%; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hero-card h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.01em; }
.hero-card .role { color: var(--text); font-size: 14px; font-weight: 600; margin: 0; }
.hero-card .loc { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; }
.stat b { display: block; font-size: 20px; letter-spacing: -0.01em; }
.stat span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }

.cert-block { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.cert-block h4 { margin: 0 0 12px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.cert-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cert { margin: 0; text-align: center; }
.cert-link { display: block; border-radius: var(--radius-sm); }
.cert-link img { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.cert-link:hover img, .cert-link:focus-visible img { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.18); }
.cert-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cert img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.about-title { font-size: 30px; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 16px; }
.about-text { color: var(--text-muted); font-size: 16.5px; margin: 0 0 16px; }
.poem { margin: 0 0 18px; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text); font-style: italic; line-height: 1.8; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.6fr);
  gap: 32px;
  align-items: start;
}

.about-intro { position: sticky; top: 96px; }
.about-values { min-width: 0; }
.about-contact-panel {
  margin-top: 24px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.about-contact {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 15px;
}
.about-contact-actions { margin-top: 0; }

.brand { margin: 0; }
.brand dt { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.brand dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.brand > div + div { border-top: 1px solid var(--border); padding-top: 16px; }
.pill { display: inline-block; margin: 0 6px 6px 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 600; }

.value-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.value-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  min-height: 100%;
}

.value-item--wide { grid-column: 1 / -1; }

.value-item--highlight {
  background: color-mix(in srgb, var(--bg-card) 88%, var(--accent-soft));
  border-color: color-mix(in srgb, var(--border) 76%, var(--accent));
}

.value-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.value-item h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.value-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.pill-group .pill {
  margin: 0;
}

.skills { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.skills-title { margin: 0 0 20px; font-size: 22px; letter-spacing: -0.01em; }
.skills-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.skill-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.skill-card h4 { margin: 0 0 14px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.skill-rows { list-style: none; margin: 0; padding: 0; }
.skill-rows li { padding: 12px 0; border-top: 1px solid var(--border); }
.skill-rows li:first-child { border-top: 0; padding-top: 0; }
.skill-rows li:last-child { padding-bottom: 0; }
.skill-rows b { display: block; font-size: 15px; color: var(--text); }
.skill-rows span { display: block; margin-top: 2px; font-size: 14px; color: var(--text-muted); }
@media (max-width: 720px) { .skills-grid { grid-template-columns: 1fr; } }

.cert figcaption { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* --------------------------------------------------------------- Section */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-weight: 750;
}

.section-head p { margin: 0; color: var(--text-muted); font-size: 15px; }

.link-more { color: var(--accent); font-weight: 600; font-size: 14.5px; white-space: nowrap; }

/* ----------------------------------------------------------------- Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.22s;
}

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

.post-thumb {
  height: 156px;
  background: linear-gradient(135deg, #1f2937, #0f172a);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.post-thumb img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.post-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(3, 8, 18, 0.08), rgba(3, 8, 18, 0.62));
}
.post-thumb span {
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(3, 8, 18, 0.68);
  backdrop-filter: blur(6px);
  text-align: center;
}
.post-card:hover .post-thumb img { transform: scale(1.04); }

.post-thumb.m365 { background: linear-gradient(135deg, #0b5cab, #1e3a8a); }
.post-thumb.win   { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.post-thumb.mac   { background: linear-gradient(135deg, #334155, #0f172a); }
.post-thumb.sec   { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.post-thumb.growth{ background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.post-thumb.dx    { background: linear-gradient(135deg, #059669, #064e3b); }

.post-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 999px;
}

.post-card h3 { margin: 0; font-size: 18px; line-height: 1.35; letter-spacing: -0.01em; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

.post-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- Filters */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }

.chip {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.18s;
  font-family: inherit;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------- Topic box */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }

.topic {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: 0.22s;
}
.topic:hover { border-color: var(--accent); transform: translateY(-3px); }
.topic .ico { font-size: 24px; margin-bottom: 12px; }
.topic h4 { margin: 0 0 6px; font-size: 16px; }
.topic p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------------------------------------------------------- Popular posts */
.popular-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.popular-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.popular-list a { font-weight: 600; }
.popular-list a:hover { color: var(--accent); }
.popular-list span { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.post-view-count { white-space: nowrap; }

/* ------------------------------------------------------------ Testimonials */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.testimonial {
  margin: 0; padding: 22px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.testimonial p { margin: 0 0 18px; color: var(--text); }
.testimonial footer { display: grid; gap: 2px; font-size: 14px; }
.testimonial footer span { color: var(--text-muted); }

/* ---------------------------------------------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
  background: var(--bg-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 32px;
}
.footer-grid h5 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { font-size: 14.5px; color: var(--text-muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-about p { color: var(--text-muted); font-size: 14.5px; margin: 10px 0 0; max-width: 42ch; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ Article page */
.article { padding: 56px 0 72px; }
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; }
.article-wrap > article { min-width: 0; width: 100%; }

.article-head h1 {
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 14px 0 16px;
  font-weight: 800;
}
.article-head .byline {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 14.5px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.article-head .byline .avatar-sm {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.article-head .byline .post-view-count { white-space: nowrap; }
.article-cover {
  width: 100%;
  height: clamp(220px, 38vw, 420px);
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.comments-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.comments-section h2 { margin: 0 0 20px; font-size: 24px; }
.comments-section .giscus,
.comments-section .giscus-frame {
  width: 100%;
  border-radius: var(--radius);
}
html[data-theme="dark"] .comments-section .giscus { background: var(--bg-card); }
html[data-theme="light"] .comments-section .giscus { background: var(--bg-card); }
.comments-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 28px;
}
.comments-section .giscus,
.comments-section iframe.giscus-frame {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.comments-section iframe.giscus-frame {
  min-height: 180px;
}

.prose { min-width: 0; width: 100%; font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.prose h2 { font-size: 26px; margin: 44px 0 14px; letter-spacing: -0.02em; scroll-margin-top: 90px; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; scroll-margin-top: 90px; }
.prose p { margin: 0 0 18px; color: color-mix(in srgb, var(--text) 88%, var(--text-muted)); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); border-bottom: 1px solid transparent; }
.prose a:hover { border-color: var(--accent); }
.prose img { border-radius: var(--radius); margin: 26px 0; border: 1px solid var(--border); }

.prose blockquote {
  margin: 26px 0;
  padding: 14px 22px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.prose blockquote p { margin: 0; color: inherit; }

.callout {
  display: flex; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin: 26px 0;
  font-size: 15.5px;
}
.callout.warn { border-left-color: #f59e0b; }
.callout.danger { border-left-color: #ef4444; }
.callout b { display: block; margin-bottom: 3px; }

.prose pre {
  background: #0b0f16;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(24.75em + 36px);
  scrollbar-gutter: stable;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: #d6e2f0;
  margin: 24px 0;
}
.prose pre > code {
  display: block;
  min-width: max-content;
  width: max-content;
  max-width: none;
  white-space: inherit;
}

.prose pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.prose pre::-webkit-scrollbar-track { background: transparent; }
.prose pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 2px solid #0b0f16;
}
.prose pre::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.prose code { font-family: var(--mono); font-size: 0.9em; }
.prose :not(pre) > code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
}

.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 650; }

/* TOC sidebar */
.toc { position: sticky; top: 90px; align-self: start; }
.toc h5 {
  margin: 0 0 12px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted);
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); display: grid; gap: 2px; }
.toc a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px; color: var(--text-muted); transition: 0.18s;
}
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); }

.share-row { display: flex; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-top: 44px;
}
.author-box .avatar {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.author-box h4 { margin: 0 0 4px; }
.author-box p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* Prev / next post navigation */
.post-nav {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  margin-top: 36px;
}
.post-nav-link {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: 0.2s;
}
.post-nav-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.post-nav-link.next { justify-content: space-between; text-align: right; }
.post-nav-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-nav-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.post-nav-title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.post-nav-arrow {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 24px; font-weight: 700; line-height: 1;
  transition: transform 0.2s;
}
.post-nav-link.prev:hover .post-nav-arrow { transform: translateX(-4px); }
.post-nav-link.next:hover .post-nav-arrow { transform: translateX(4px); }

/* Reading progress bar */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100; transition: width 0.1s linear;
}

/* ------------------------------------------------------------ Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .article-wrap { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  .container { padding-inline: 14px; }
  .article { padding: 36px 0 52px; }
  .article-head h1 { font-size: 28px; overflow-wrap: anywhere; }
  .article-cover {
    height: 220px;
    margin-bottom: 24px;
    border-radius: 10px;
  }
  .article-head .byline {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 10px;
    font-size: 13px;
    margin-bottom: 24px;
  }
  .prose { font-size: 16px; line-height: 1.75; }
  .prose h2 { font-size: 23px; margin-top: 36px; }
  .prose h3 { font-size: 18px; }
  .prose pre {
    padding: 14px 12px;
    margin-inline: 0;
    max-height: 420px;
    font-size: 12px;
    line-height: 1.55;
    border-radius: 6px;
  }
  .prose pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  .prose table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .prose blockquote { padding: 12px 14px; }
  .callout { gap: 10px; padding: 14px 12px; }
  .share-row { flex-wrap: wrap; }
  .share-row .btn { flex: 1 1 calc(50% - 4px); justify-content: center; text-align: center; }
  .author-box { padding: 16px; gap: 12px; }
  .author-box .avatar { width: 48px; height: 48px; }
  .nav-toggle { display: grid; }
  .nav-actions { gap: 6px; }
  .language-toggle { min-width: 42px; height: 34px; padding-inline: 8px; }
  .site-search { padding: 12px 16px; }
  .site-search-form,
  .search-page-form { flex-direction: column; }
  .search-page-form .btn,
  .site-search-form .btn { justify-content: center; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 20px; gap: 2px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero { padding: 56px 0 44px; }
  .comments-section { margin-top: 36px; padding: 16px; }
  .comments-section h2 { font-size: 21px; }
  .section { padding: 52px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .about-intro { position: static; }
  .value-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .value-item--wide { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
}
