@import url("pygment_highlights.css");

:root {
  /* Liquid-injected colors (kept for backwards compatibility) */
  --page-col: #0B0B1A;
  --text-col: #ECECF1;
  --link-col: #A78BFA;
  --hover-col: #F472B6;
  --navbar-col: #0B0B1A;
  --navbar-text-col: #BEBED5;
  --navbar-border-col: rgba(255,255,255,0.07);
  --footer-col: #0B0B1A;
  --footer-text-col: #9B9BB5;
  --footer-link-col: #ECECF1;
  --footer-hover-col: #A78BFA;

  /* Design system tokens */
  --bg: #0B0B1A;
  --bg-2: #07071A;
  --surface: #15152B;
  --surface-hi: #1B1B36;
  --surface-2: #11112A;
  --border: rgba(255, 255, 255, 0.07);
  --border-hi: rgba(255, 255, 255, 0.14);
  --text: #ECECF1;
  --muted: #9B9BB5;
  --muted-hi: #BEBED5;
  --violet: #A78BFA;
  --pink: #F472B6;
  --cyan: #67E8F9;
  --gradient: linear-gradient(120deg, var(--violet) 0%, var(--pink) 50%, var(--cyan) 100%);
  --gradient-soft: linear-gradient(120deg, rgba(167,139,250,0.18), rgba(244,114,182,0.12), rgba(103,232,249,0.10));

  --body-font: 'Inter', system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --header-font: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --mid-col: var(--muted);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 80px -20px rgba(167, 139, 250, 0.3);

  --nav-h: 72px;
  --nav-h-short: 56px;
  --safe-l: env(safe-area-inset-left);
  --safe-r: env(safe-area-inset-right);
}

/* --- Base --- */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main { flex: 1; }

::selection { background: rgba(167, 139, 250, 0.35); color: var(--text); }

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 1.5rem 0 0.75rem;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.625rem, 2.6vw, 2rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9375rem; color: var(--muted-hi); }

p {
  line-height: 1.65;
  margin: 1.125rem 0;
  color: var(--text);
}

a {
  color: var(--violet);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover, a:focus {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
hr.small {
  width: 80px;
  margin: 1rem auto;
  border-top-width: 2px;
  border-color: var(--border-hi);
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--violet);
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--muted-hi);
  font-style: italic;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

code, pre, kbd, samp {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

code {
  background: var(--surface-hi);
  color: var(--cyan);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-2);
  color: var(--text);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.5rem 0;
}
pre code {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
}

/* Custom dark scrollbar for code blocks */
pre::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { height: 10px; }
pre::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }
pre::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 999px;
}
pre::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
th, td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th {
  font-family: var(--header-font);
  font-weight: 600;
  background: var(--surface);
  color: var(--muted-hi);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

ul, ol { padding-left: 1.5rem; }
ul li, ol li { margin: 0.4rem 0; }

/* Bootstrap text utility overrides */
.text-muted { color: var(--muted) !important; }
.text-center { text-align: center; }

/* --- Layout helpers --- */

.container,
.container-md,
.container-lg,
.container-xl {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
}
.container-md, .container-lg, .container-xl { max-width: 1180px; }
@media (min-width: 1280px) {
  .container-md { max-width: 1180px; }
}

main {
  padding-top: 0;
  padding-bottom: 4rem;
}
main.main-noheader {
  padding-top: calc(var(--nav-h) + 2.5rem);
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glass {
  background: rgba(11, 11, 26, 0.65);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

/* --- Navbar --- */

.navbar.navbar-custom {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  height: var(--nav-h);
  padding: 0 calc(1.5rem + var(--safe-r)) 0 calc(1.5rem + var(--safe-l));
  background: rgba(11, 11, 26, 0.78);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
  transition: height 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
}

@supports not (backdrop-filter: blur(1px)) {
  .navbar.navbar-custom { background: var(--bg); }
}

.navbar.navbar-custom.top-nav-short,
.navbar.navbar-custom.top-nav-short-permanent { height: var(--nav-h-short); }

.navbar.navbar-custom .navbar-brand {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  letter-spacing: -0.01em;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
}
.navbar.navbar-custom .navbar-brand::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.6);
  flex-shrink: 0;
}
.navbar.navbar-custom .navbar-brand:hover { color: var(--text); text-decoration: none; }
.navbar.navbar-custom .navbar-brand-logo::before { display: none; }
.navbar.navbar-custom .navbar-brand-logo img { height: 32px; width: auto; }

.navbar-toggler {
  margin-left: auto;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.navbar-toggler:focus { outline: 0; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3); }
.navbar-toggler-icon {
  width: 22px; height: 2px;
  background: var(--text);
  display: block;
  position: relative;
}
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--text);
}
.navbar-toggler-icon::before { top: -7px; }
.navbar-toggler-icon::after { top: 7px; }

.navbar.navbar-custom .navbar-collapse { flex-grow: 1; }

.navbar.navbar-custom .navbar-nav { gap: 0.25rem; }

.navbar.navbar-custom .nav-item .nav-link {
  font-family: var(--header-font);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--muted-hi);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.navbar.navbar-custom .nav-item .nav-link:hover,
.navbar.navbar-custom .nav-item .nav-link:focus {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
}

.navbar.navbar-custom .dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  margin-top: 0.5rem;
}
.navbar.navbar-custom .dropdown-item {
  color: var(--muted-hi);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-family: var(--header-font);
  font-size: 0.9375rem;
}
.navbar.navbar-custom .dropdown-item:hover,
.navbar.navbar-custom .dropdown-item:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

#nav-search-link { gap: 0.5rem; }
#nav-search-icon { color: var(--violet); }

/* Avatar in navbar */
.avatar-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.avatar-img-border {
  width: 50px; height: 50px;
  pointer-events: auto;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  padding: 2px;
  background: var(--bg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.avatar-img-border:hover {
  transform: scale(1.05);
  border-color: var(--violet);
}
.avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.navbar.navbar-custom.top-nav-short .avatar-img-border { width: 40px; height: 40px; }

/* JS adds .navbar-light or .navbar-dark — neutralize Bootstrap dark/light */
.navbar.navbar-custom.navbar-light .navbar-toggler-icon,
.navbar.navbar-custom.navbar-dark .navbar-toggler-icon { background: var(--text); }

/* --- Mobile nav --- */
@media (max-width: 1199px) {
  .navbar.navbar-custom { padding: 0 1.125rem; flex-wrap: wrap; }

  .navbar.navbar-custom .navbar-brand { order: 0; }
  .avatar-container {
    order: 2;
    position: static;
    transform: none;
    margin-left: auto;
    margin-right: 0.625rem;
  }
  .navbar-toggler { order: 3; margin-left: 0; }
  .navbar.navbar-custom .navbar-collapse {
    order: 4;
    flex-basis: 100%;
    width: 100%;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(11, 11, 26, 0.96);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    padding: 1.5rem 1.5rem 4rem;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
  }
  .navbar.navbar-custom .navbar-collapse:not(.show) { display: none; }
  .navbar.navbar-custom .navbar-collapse.collapsing,
  .navbar.navbar-custom .navbar-collapse.show { display: block; }

  .navbar.navbar-custom .navbar-nav { flex-direction: column; gap: 0; margin-left: 0 !important; }
  .navbar.navbar-custom .nav-item {
    border-bottom: 1px solid var(--border);
  }
  .navbar.navbar-custom .nav-item .nav-link {
    width: 100%;
    border-radius: 0;
    padding: 1rem 0;
    font-size: 1.125rem;
    color: var(--text);
    justify-content: space-between;
  }
  .navbar.navbar-custom .nav-item .nav-link:hover,
  .navbar.navbar-custom .nav-item .nav-link:focus { background: transparent; color: var(--violet); }

  .navbar.navbar-custom .dropdown-menu {
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.5rem 0;
    margin: 0;
  }
  .navbar.navbar-custom .dropdown-item { padding: 0.5rem 0; font-size: 1rem; }

  .navbar.navbar-custom.top-nav-expanded .avatar-container { display: none; }
}

/* --- Hero / page header (header.html) --- */

.header-section {
  position: relative;
  background: var(--bg);
}

.intro-header {
  position: relative;
  padding: calc(var(--nav-h) + 2.5rem) 0 2.5rem;
  background: var(--bg);
}

.intro-header.big-img {
  position: relative;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center;
  padding: clamp(8rem, 16vw, 13rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.intro-header.big-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(167, 139, 250, 0.25), transparent 60%),
    linear-gradient(180deg, rgba(11, 11, 26, 0.4) 0%, rgba(11, 11, 26, 0.85) 60%, var(--bg) 100%);
  z-index: 1;
}
.intro-header.big-img > .container-md,
.intro-header.big-img > .img-desc { position: relative; z-index: 2; }

.big-img-transition {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 0;
}

.img-desc {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--header-font);
  letter-spacing: 0.04em;
  z-index: 2;
}

.page-heading h1,
.post-heading h1 {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 0.875rem;
  color: var(--text);
}

.page-heading hr.small { border-color: var(--border-hi); }
.page-subheading,
.post-subheading {
  font-family: var(--header-font);
  font-weight: 400;
  font-size: clamp(1.0625rem, 1.75vw, 1.375rem);
  color: var(--muted-hi);
  line-height: 1.45;
  display: block;
  max-width: 60ch;
  margin: 0 0 1rem;
}

.post-meta {
  font-family: var(--header-font);
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 1rem;
  display: inline-block;
}
.middot { color: var(--border-hi); margin: 0 0.4em; }

#header-gh-btns {
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --- Home page hero (custom layout) --- */

.home-hero {
  position: relative;
  padding: clamp(6rem, 10vw, 9rem) 0 clamp(3rem, 6vw, 6rem);
  overflow: hidden;
  isolation: isolate;
}
.home-hero .blob {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.55;
  border-radius: 50%;
  will-change: transform;
}
.home-hero .blob-1 {
  width: clamp(280px, 45vw, 560px); height: clamp(280px, 45vw, 560px);
  background: radial-gradient(circle, var(--violet), transparent 65%);
  top: -100px; left: -80px;
}
.home-hero .blob-2 {
  width: clamp(240px, 40vw, 480px); height: clamp(240px, 40vw, 480px);
  background: radial-gradient(circle, var(--pink), transparent 60%);
  top: 40px; right: -60px;
}
.home-hero .blob-3 {
  width: clamp(220px, 35vw, 420px); height: clamp(220px, 35vw, 420px);
  background: radial-gradient(circle, var(--cyan), transparent 60%);
  bottom: -120px; left: 30%;
  opacity: 0.35;
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .home-hero .blob-1 { animation: drift1 18s ease-in-out infinite; }
  .home-hero .blob-2 { animation: drift2 22s ease-in-out infinite; }
  .home-hero .blob-3 { animation: drift3 26s ease-in-out infinite; }
}
@keyframes drift1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, 40px); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-50px, 30px); } }
@keyframes drift3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.05); } }

.home-hero-inner { position: relative; max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--header-font);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-hi);
  margin-bottom: 2rem;
  min-height: 32px;
  max-width: 100%;
}
.eyebrow-pill .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  flex-shrink: 0;
}

.home-hero-title {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 1.75rem;
  max-width: 14ch;
  color: var(--text);
}

.home-hero-sub {
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
  color: var(--muted-hi);
  max-width: 56ch;
  line-height: 1.5;
  margin: 0 0 2.5rem;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Buttons --- */

.btn-primary,
.btn-ghost,
a.btn-primary,
a.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--header-font);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  min-height: 44px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary, a.btn-primary {
  color: #0B0B1A;
  background: var(--gradient);
  box-shadow: 0 12px 40px -10px rgba(167, 139, 250, 0.55);
}
.btn-primary:hover, a.btn-primary:hover {
  transform: translateY(-2px);
  color: #0B0B1A;
  box-shadow: 0 20px 50px -10px rgba(244, 114, 182, 0.55);
}
.btn-primary:active, a.btn-primary:active { transform: translateY(0); }

.btn-ghost, a.btn-ghost {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.04);
}
.btn-ghost:hover, a.btn-ghost:hover {
  color: var(--text);
  border-color: var(--violet);
  background: rgba(255, 255, 255, 0.07);
}

/* Tag-page button (Bootstrap btn-primary used as tag button) */
.btn.btn-primary.tag-btn,
.btn.btn-primary.tag-btn:focus {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-hi);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
  font-family: var(--header-font);
  font-weight: 500;
  font-size: 0.85rem;
  margin: 0.25rem;
  transition: all 0.15s ease;
  text-decoration: none;
  box-shadow: none;
  min-height: 36px;
}
.btn.btn-primary.tag-btn:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #0B0B1A;
  text-decoration: none;
}

/* --- Sections (used by home and other long pages) --- */

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-top: 1px solid var(--border);
}
.section-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--header-font);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 1rem;
}
.section-eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, var(--violet), transparent);
}
.section-title {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
  max-width: 22ch;
}

/* --- About block on home --- */

.home-about {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.home-about-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--gradient-soft);
}
.home-about-aside .av {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  margin-bottom: 1rem;
  background: var(--surface);
}
.home-about-aside h3 {
  font-family: var(--header-font);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.home-about-aside .role {
  color: var(--muted-hi);
  font-size: 0.875rem;
  margin: 0 0 1.125rem;
}
.home-about-aside ul {
  list-style: none; padding: 0; margin: 0;
  font-size: 0.8125rem; color: var(--muted-hi);
}
.home-about-aside li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}
.home-about-aside li span:last-child {
  color: var(--text);
  font-family: var(--header-font);
}
.home-about-body p {
  font-size: 1.1875rem;
  color: #D2D2E0;
  margin: 0 0 1.4rem;
  line-height: 1.7;
}
.home-about-body p:first-child { font-size: 1.375rem; color: var(--text); }
.home-about-body strong { color: var(--text); font-weight: 500; }

/* --- Magazine post grid (home) --- */

.post-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  grid-auto-rows: minmax(320px, auto);
}
.post-grid.post-grid-blog {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(280px, auto);
  margin-top: 1rem;
}
@media (max-width: 1023px) {
  .post-grid.post-grid-blog { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
}
@media (max-width: 767px) {
  .post-grid.post-grid-blog { grid-template-columns: 1fr; }
}
.post-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none !important;
  color: var(--text);
  min-height: 260px;
  display: block;
}
.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.post-card:active { transform: translateY(-1px); }
.post-card.feat { grid-row: span 2; grid-column: 1; }

.post-card .img {
  height: 100%;
  min-height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.post-card .img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(11, 11, 26, 0.95) 100%);
}
.post-card .body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem;
  z-index: 2;
}
.post-card .meta {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  font-family: var(--header-font);
  font-size: 0.75rem;
  color: var(--muted-hi);
  margin-bottom: 0.625rem;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.post-card .meta .pill {
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.post-card.feat h3 {
  font-family: var(--header-font);
  font-size: clamp(1.375rem, 2.5vw, 2rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0 0 0.625rem;
  max-width: 22ch;
  color: var(--text);
}
.post-card.feat .sub {
  font-size: 0.9375rem;
  color: var(--muted-hi);
  margin: 0;
  max-width: 56ch;
}
.post-card:not(.feat) h3 {
  font-family: var(--header-font);
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 0.4rem;
  color: var(--text);
}
.post-card:not(.feat) .sub {
  font-size: 0.8125rem;
  color: var(--muted-hi);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .arrow {
  position: absolute;
  top: 1.125rem;
  right: 1.125rem;
  z-index: 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-hi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.post-card:hover .arrow {
  background: var(--gradient);
  border-color: transparent;
  color: #0B0B1A;
  transform: rotate(-45deg);
}

/* --- Posts list (used by /blog/, paginator > 1) --- */

.posts-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
}
.posts-list .post-preview {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
  margin: 0;
  position: relative;
}
.posts-list .post-preview:first-child { border-top: 1px solid var(--border); }
.posts-list .post-preview article {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}
.posts-list .post-preview a { color: inherit; text-decoration: none; }
.posts-list .post-preview .post-image {
  grid-column: 1; grid-row: 1 / span 4;
  width: 220px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.posts-list .post-preview .post-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.posts-list .post-preview:hover .post-image img { transform: scale(1.04); }
.posts-list .post-preview .post-image-small,
.posts-list .post-preview .post-image-short { display: none; }
.posts-list .post-title {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0 0 0.5rem;
  color: var(--text);
  transition: color 0.15s ease;
}
.posts-list .post-preview:hover .post-title { color: var(--violet); }
.posts-list .post-subtitle {
  font-family: var(--header-font);
  font-weight: 400;
  font-size: 1rem;
  color: var(--muted-hi);
  line-height: 1.5;
  margin: 0 0 0.75rem;
  max-width: 60ch;
}
.posts-list .post-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
  display: block;
}
.posts-list .post-entry {
  margin-top: 0.75rem;
  color: var(--muted-hi);
  font-size: 0.9375rem;
  max-width: 65ch;
}
.posts-list .post-read-more {
  color: var(--violet);
  font-weight: 500;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.blog-tags {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.blog-tags > span { color: var(--muted); margin-right: 0.25rem; }
.blog-tags ul { display: inline; padding: 0; margin: 0; list-style: none; }
.blog-tags ul li { display: inline-block; margin: 0.125rem; }
.blog-tags a {
  display: inline-block;
  font-family: var(--header-font);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-hi);
  text-decoration: none;
  transition: all 0.15s ease;
  margin: 0.125rem 0.25rem 0.125rem 0;
}
.blog-tags a:hover {
  border-color: var(--violet);
  color: var(--text);
  background: rgba(167, 139, 250, 0.1);
  text-decoration: none;
}

/* --- Single post body --- */

.blog-post {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #D6D6E1;
  max-width: 70ch;
}
.blog-post h1, .blog-post h2, .blog-post h3, .blog-post h4 {
  margin-top: 2.25rem;
  color: var(--text);
}
.blog-post h2 { font-size: 1.625rem; }
.blog-post h3 { font-size: 1.25rem; }
.blog-post p { margin: 1.125rem 0; }
.blog-post p strong, .blog-post strong { color: var(--text); font-weight: 600; }
.blog-post a {
  color: var(--violet);
  border-bottom: 1px solid rgba(167, 139, 250, 0.4);
  text-decoration: none;
  transition: all 0.15s ease;
}
.blog-post a:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}
.blog-post img {
  border-radius: var(--radius-md);
  margin: 2rem auto;
  max-width: 100%;
  border: 1px solid var(--border);
}
.blog-post ul, .blog-post ol { margin: 1.125rem 0; padding-left: 1.5rem; }
.blog-post li { margin: 0.5rem 0; }
.blog-post hr { margin: 2.5rem 0; }

/* --- Pagination --- */

.pagination,
.pagination.main-pager,
ul.pagination.blog-pager {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 0;
  margin: 3rem 0 1rem;
  flex-wrap: wrap;
}
.pagination .page-item { margin: 0; }
.pagination .page-item.next { margin-left: auto; }
.pagination .page-item.previous { margin-right: auto; }
.pagination .page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
  color: var(--muted-hi);
  font-family: var(--header-font);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 44px;
}
.pagination .page-link:hover,
.pagination .page-link:focus {
  border-color: var(--violet);
  color: var(--text);
  background: rgba(167, 139, 250, 0.1);
  text-decoration: none;
}

/* --- Footer --- */

footer:not(.footer-min) {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 4rem 0 3rem;
  margin-top: 4rem;
}
.beautiful-jekyll-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.beautiful-jekyll-footer .row,
.beautiful-jekyll-footer [class*="col-"] {
  margin: 0;
  padding: 0;
  flex: 0 0 100%;
  max-width: 100%;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links li { margin: 0; }
.footer-links a {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
  color: var(--muted-hi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
  text-decoration: none;
}
.footer-links a:hover,
.footer-links a:focus {
  background: var(--gradient);
  border-color: transparent;
  color: #0B0B1A;
  text-decoration: none;
  transform: translateY(-2px);
}
/* Hide the Font Awesome stacked-circle background on dark */
.footer-links .fa-stack-2x { display: none; }
.footer-links .fa-stack-1x.fa-inverse { color: inherit; position: static; line-height: 1; font-size: 1.125rem; }
.footer-links .fa-stack { width: auto; height: auto; line-height: 1; }

.copyright,
.theme-by {
  text-align: center;
  font-family: var(--header-font);
  font-size: 0.8125rem;
  color: var(--muted) !important;
  margin: 0.75rem 0 0;
  letter-spacing: 0.02em;
}
.copyright a,
.theme-by a {
  color: var(--muted-hi);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}
.copyright a:hover,
.theme-by a:hover {
  color: var(--violet);
  border-bottom-color: var(--violet);
}
.author-site a { color: var(--text); }

footer.footer-min {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--header-font);
  font-size: 0.8125rem;
}

/* --- Tags page --- */

#full-tags-list { margin-top: 3rem; }
.linked-section {
  font-family: var(--header-font);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.linked-section i { color: var(--violet); }

.tag-entry {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.tag-entry:last-child { border-bottom: 0; }
.tag-entry > a {
  font-family: var(--header-font);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--text);
}
.tag-entry > a:hover { color: var(--violet); }
.tag-entry .entry-date {
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: var(--header-font);
  letter-spacing: 0.04em;
}

/* --- Search overlay --- */

#beautifuljekyll-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 26, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  z-index: 2000;
  padding: clamp(2rem, 8vw, 5rem) 1rem 1rem;
}
#beautifuljekyll-search-overlay.active { display: block; }

#nav-search-input {
  display: block;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  font-family: var(--header-font);
  font-size: 1.125rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-md);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#nav-search-input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
}

#nav-search-exit {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.15s ease;
}
#nav-search-exit:hover { border-color: var(--violet); color: var(--violet); }

#search-results-container {
  list-style: none;
  padding: 0;
  margin: 1.5rem auto 0;
  max-width: 720px;
}
#search-results-container li {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}
#search-results-container li a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--header-font);
  font-weight: 500;
}
#search-results-container li a:hover { color: var(--violet); }

/* --- Social share buttons --- */

#social-share-section {
  margin: 2.5rem 0 1rem;
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn.btn-social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hi);
  color: var(--muted-hi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1rem;
  padding: 0;
  text-decoration: none !important;
}
.btn.btn-social-icon:hover,
.btn.btn-social-icon:focus {
  background: var(--gradient);
  border-color: transparent;
  color: #0B0B1A;
  transform: translateY(-2px);
  text-decoration: none;
}

/* --- Responsive overrides --- */

@media (max-width: 1023px) {
  .post-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(240px, auto); }
  .post-card.feat { grid-column: span 2; grid-row: auto; }
  .home-about { grid-template-columns: 1fr; gap: 2rem; }
  .home-about-aside { position: static; }
}

@media (max-width: 767px) {
  body { font-size: 0.9375rem; }
  main { padding-top: calc(var(--nav-h) + 1rem); }

  .container, .container-md, .container-lg, .container-xl,
  .home-hero-inner, .section-wrap, .beautiful-jekyll-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .home-hero { padding: 4rem 0 3rem; }

  .post-grid { grid-template-columns: 1fr; gap: 1rem; grid-auto-rows: auto; }
  .post-card { min-height: 220px; }
  .post-card.feat { grid-column: auto; grid-row: auto; }
  .post-card .img { min-height: 220px; }
  .post-card.feat h3 { font-size: 1.25rem; }
  .post-card .body { padding: 1.125rem; }

  .posts-list .post-preview article { grid-template-columns: 1fr; gap: 1rem; }
  .posts-list .post-preview .post-image {
    grid-row: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  /* Big-img header collapses neatly */
  .intro-header.big-img { padding: 7rem 0 2.5rem; }

  .blog-post { font-size: 1rem; line-height: 1.7; }
  .blog-post img { margin: 1.5rem auto; }

  /* Pagination wraps */
  .pagination { gap: 0.5rem; }
  .pagination .page-link { padding: 0.625rem 1rem; font-size: 0.875rem; }

  /* Footer compresses */
  footer:not(.footer-min) { padding: 3rem 0 2rem; margin-top: 3rem; }
  .footer-links a { width: 42px; height: 42px; }

  /* Tag entry stacks */
  .tag-entry { gap: 0.25rem; }
}

@media (max-width: 479px) {
  .home-hero-title { font-size: 2.25rem; line-height: 1.05; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn-primary, .cta-row .btn-ghost { justify-content: center; }
  .home-about-aside { padding: 1.25rem; }
  .home-about-aside .av { width: 72px; height: 72px; }
  .eyebrow-pill {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print --- */

@media print {
  body { background: #fff; color: #000; }
  .navbar, footer, .home-hero .blob, .pagination, #social-share-section { display: none !important; }
  .blog-post { color: #000; max-width: 100%; }
  .blog-post a { color: #000; border-bottom-color: #999; }
}

/* --- Utility / accessibility --- */

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

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Body lock when search overlay is open */
body.overflow-hidden { overflow: hidden; }
