/* ═══════════════════════════════════════════════════════════
   Cloudpartner – Main Stylesheet
   Dark terminal design – JetBrains Mono + Inter
   ═══════════════════════════════════════════════════════════ */

/* ── 1. THEME VARIABLES ─────────────────────────────────── */
:root {
  --acc: #14c4b8;
  --olive: #c8b820;
  --nav-h: 72px;
  --spec-h: 33px;
  --header-h: calc(var(--nav-h) + var(--spec-h));
  --radius: 4px;
  --transition: 0.15s ease;
  --seg1: #0c6868;
  --seg2: #4d5c0a;
  --seg3: #2a3848;
  --seg4: #1a1a2a;

  /* Legacy class compatibility */
  --max-width: 1200px;
  --sidebar-width: 220px;
  --toc-width: 260px;
}

[data-theme="dark"] {
  --bg: #112424;
  --bg-sec: #091818;
  --brd: #193d3d;
  --text: #dbece8;
  --mut: #94c0bc;
  --card: #0f2121;
  --border: #193d3d;
  --bg-alt: #091818;
  --text-light: #699a96;
  --code-bg: #040e0e;
  --code-brd: #0d2828;

  /* Backwards-compat aliases */
  --primary-color: var(--acc);
  --accent: var(--olive);
  --muted: var(--mut);
  --surface: var(--card);
}

[data-theme="light"] {
  --bg: #edf9f6;
  --bg-sec: #ddf2ec;
  --brd: #a8d8d0;
  --text: #082020;
  --mut: #2e6060;
  --card: #ffffff;
  --border: #a8d8d0;
  --bg-alt: #ddf2ec;
  --text-light: #2e6060;
  --code-bg: #f0faf8;
  --code-brd: #c0e0da;

  --primary-color: var(--acc);
  --accent: var(--olive);
  --muted: var(--mut);
  --surface: var(--card);
}

/* ── 2. RESET + BASE ────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
}

img {
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ── 3. CONTAINER ───────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── 4. STICKY HEADER ───────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ── 5. POWERLINE NAV ───────────────────────────────────── */
.nav-bar {
  background: #040808;
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--brd);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  transition: border-color var(--transition);
}

.segs {
  display: flex;
  align-items: stretch;
  gap: 3px;
}

.seg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px 0 18px;
  height: 100%;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
  white-space: nowrap;
  transition: filter var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.seg:hover {
  filter: brightness(1.2);
}

.seg1 {
  background: var(--seg1);
}

.seg2 {
  background: var(--seg2);
}

.seg3 {
  background: var(--seg3);
}

.seg4 {
  background: var(--seg4);
}

.seg5 {
  background: #1d1432;
}

.seg5 span {
  color: #b8a8f0;
  font-size: 12px;
  font-weight: 600;
}

.seg5-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.seg .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 10%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.seg1 span {
  color: #d4f4f0;
  font-weight: 700;
  font-size: 13px;
}

.seg4 .mvp-badge {
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.seg4 span {
  color: var(--acc);
  font-size: 11px;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  padding-right: 32px;
  font-size: 12px;
}

.nav-link {
  color: #5a8888;
  transition: color var(--transition);
  font-family: 'JetBrains Mono', monospace;
}

.nav-link:hover,
.nav-link.active {
  color: var(--acc);
}

.nav-link .pref {
  color: var(--acc);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--acc);
  color: var(--acc);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  letter-spacing: 1px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--acc);
  color: #040808;
}

/* ── 6. SPEC ROW ────────────────────────────────────────── */
.spec-row {
  background: #040808;
  height: var(--spec-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-bottom: 1px solid var(--brd);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  transition: border-color var(--transition);
  overflow: hidden;
}

.spec-row .arrow {
  color: var(--acc);
}

.spec-row .spec-item {
  color: #7ab0a8;
}

.spec-row .dot {
  color: #1e3838;
}

.spec-row .cursor {
  margin-left: auto;
  color: var(--acc);
  animation: blink 1.2s step-end infinite;
}

/* ── 7. BREADCRUMB ──────────────────────────────────────── */
.breadcrumb {
  background: #040808;
  border-bottom: 1px solid var(--brd);
  padding: 0 52px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  transition: border-color var(--transition);
}

.breadcrumb a {
  color: #5a8888;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--acc);
}

.breadcrumb .sep {
  color: #1e3838;
}

.breadcrumb .current {
  color: var(--acc);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 480px;
}

/* ── 8. POST WRAPPER (3-col layout) ─────────────────────── */
.post-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 52px;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 40px;
  align-items: start;
}

.post-article {
  min-width: 0;
}

.post-wrapper.post-wrapper-wide-gap {
  column-gap: 56px;
}

.post-wrapper.post-wrapper-wide-gap .post-toc {
  margin-right: 0;
}

/* ── 9. LEGACY POST LAYOUT (backward compat) ────────────── */
.layout-with-sidebar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 52px;
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 56px;
  align-items: flex-start;
}

.main-col {
  grid-column: 1 / 3;
  min-width: 0;
}

.post-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.post-content {
  flex: 1 1 0%;
  min-width: 0;
  overflow-wrap: break-word;
  overflow-x: auto;
}

.post-body {
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  display: flex;
  flex-direction: column;
  grid-column: 3;
}

/* ── 10. TABLE OF CONTENTS ──────────────────────────────── */
.post-toc {
  position: sticky;
  top: calc(var(--header-h) + 48px);
  width: var(--toc-width);
  flex: 0 0 var(--toc-width);
}

/* Some migrated posts still include inline .post-toc styles from old templates.
   Keep the outer TOC wrapper neutral so only .toc-inner defines the visual card. */
.post-wrapper .post-toc {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.toc-inner {
  background: var(--card);
  border: 1px solid var(--brd);
  border-left: 3px solid color-mix(in srgb, var(--acc) 50%, transparent);
  padding: 18px;
  transition: background var(--transition), border-color var(--transition);
}

.toc-inner h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.toc-ps {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  margin-bottom: 10px;
}

.toc-ps .p {
  color: var(--olive);
}

.toc-ps .c {
  color: var(--acc);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  padding: 5px 0 5px 12px;
  border-left: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toc-item:hover,
.toc-item.active {
  color: var(--acc);
  border-left-color: var(--acc);
}

.toc-item .arr {
  color: var(--acc);
  font-size: 8px;
}

/* Legacy TOC styles */
.post-toc h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 .5rem;
}

.post-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.post-toc li {
  margin: .35rem 0;
}

.post-toc a {
  color: var(--mut);
  text-decoration: none;
  padding: 3px 6px;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  transition: color var(--transition);
}

.post-toc a.active {
  color: var(--acc);
  border-left: 2px solid var(--acc);
}

/* ── 11. ARTICLE CONTENT ────────────────────────────────── */
.post-header {
  margin-bottom: 1.5rem;
}

.post-content h1,
.post-header h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 16px;
  transition: color var(--transition);
}

.post-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 1.5rem;
}

/* Handoff post header parity */
.post-header-block {
  margin-bottom: 32px;
}

.post-article .post-ps-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.post-article .post-ps-line .ps-kw {
  color: #0d8a80;
  font-weight: 700;
}

.post-article .post-ps-line .ps-usr {
  color: var(--acc);
}

.post-article .post-ps-line .ps-pth {
  color: #2d5c58;
}

[data-theme="light"] .post-article .post-ps-line .ps-pth {
  color: #5a9090;
}

.post-article .post-ps-line .ps-cmd {
  color: var(--text);
}

.post-article .post-header-block h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 16px;
}

.post-article .post-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  margin-bottom: 16px;
}

.post-article .post-meta-row .meta-sep {
  color: var(--brd);
}

.post-article .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.post-article .post-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
  padding: 3px 10px;
  cursor: pointer;
}

.post-article .post-tag:hover {
  background: color-mix(in srgb, var(--acc) 12%, transparent);
}

.post-content h2,
.post-body h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brd);
  transition: color var(--transition), border-color var(--transition);
}

.post-content h3,
.post-body h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--acc);
  margin-top: 28px;
  margin-bottom: 10px;
}

.post-content h4,
.post-body h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 20px;
  margin-bottom: 8px;
}

.post-content p,
.post-body p {
  margin-bottom: 18px;
}

.post-content a,
.post-body a {
  color: var(--acc);
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: opacity var(--transition);
}

.post-content a:hover,
.post-body a:hover {
  opacity: 0.8;
}

.post-content strong,
.post-body strong {
  font-weight: 700;
  color: var(--text);
}

.post-content em,
.post-body em {
  color: var(--mut);
  font-style: italic;
}

.post-content ul,
.post-content ol,
.post-body ul,
.post-body ol {
  padding-left: 20px;
  margin-bottom: 18px;
  color: var(--text);
}

.post-content li,
.post-body li {
  margin-bottom: 8px;
}

.post-header-image {
  margin: 1rem 0 1.5rem 0;
}

.post-header-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-header-img img {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  display: block;
}

.post-content figure,
.post-body figure {
  max-width: 100%;
  overflow-x: auto;
}

.post-content img,
.post-content svg,
.post-body img,
.post-body svg,
.post-body iframe {
  max-width: 100%;
  height: auto;
}

/* Post visual parity layer for migrated legacy markup */
.layout-with-sidebar.post-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 56px;
  align-items: start;
}

.layout-with-sidebar.post-wrapper .main-col {
  grid-column: 1 / 3;
  min-width: 0;
}

.layout-with-sidebar.post-wrapper .sidebar {
  grid-column: 3;
}

.layout-with-sidebar .main-col .post-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

.layout-with-sidebar .main-col .post-layout>.post-content:only-child {
  grid-column: 1 / -1;
}

.layout-with-sidebar .main-col .post-layout .post-toc {
  position: sticky;
  top: calc(var(--header-h) + 48px);
  background: var(--card);
  border: 1px solid var(--brd);
  border-left: 3px solid color-mix(in srgb, var(--acc) 50%, transparent);
  padding: 18px;
  border-radius: 2px;
}

.layout-with-sidebar .main-col .post-layout .post-toc h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.layout-with-sidebar .main-col .post-layout .post-toc a {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  padding: 6px 0 6px 10px;
  border-left: 1px solid transparent;
}

.layout-with-sidebar .main-col .post-layout .post-toc a:hover,
.layout-with-sidebar .main-col .post-layout .post-toc a.active {
  color: var(--acc);
  border-left-color: var(--acc);
}

.layout-with-sidebar .main-col .post-layout .post-content {
  min-width: 0;
}

.layout-with-sidebar .sidebar {
  width: 260px;
  flex: 0 0 260px;
}

.layout-with-sidebar .main-col .post-header {
  margin-bottom: 24px;
}

.layout-with-sidebar .main-col .post-header h1 {
  font-size: clamp(32px, 3vw, 46px);
}

.layout-with-sidebar .main-col .post-header {
  margin-bottom: 28px;
}

.layout-with-sidebar .main-col .post-header .post-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
}

.layout-with-sidebar .main-col .post-header-image {
  margin: 0 0 24px;
}

.layout-with-sidebar .main-col .post-header-image img {
  width: 100%;
  border: 1px solid var(--brd);
  object-fit: cover;
}

.layout-with-sidebar .main-col .post-content table th {
  background: color-mix(in srgb, var(--acc) 12%, var(--card)) !important;
  color: var(--acc) !important;
  border: 1px solid var(--brd) !important;
}

.layout-with-sidebar .main-col .post-content table td {
  color: var(--mut) !important;
  border: 1px solid var(--brd) !important;
}

.layout-with-sidebar .main-col .post-content table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--acc) 3%, transparent) !important;
}

/* ── 12. CODE & PRE ──────────────────────────────────────── */
code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Courier New', monospace;
  font-size: 12px;
  background: var(--code-bg);
  border: 1px solid var(--code-brd);
  color: var(--acc);
  padding: 1px 6px;
  transition: background var(--transition), border-color var(--transition);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-brd);
  border-left: 3px solid var(--acc);
  padding: 0;
  margin: 1.25rem 0;
  overflow: auto;
  position: relative;
}

pre code {
  display: block;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.pre-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--code-brd);
  background: color-mix(in srgb, var(--acc) 5%, transparent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
}

.pre-header .pre-lang {
  color: var(--acc);
}

.pre-header .pre-dots {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.pre-header .pre-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pre-header .pre-dots span:nth-child(1) {
  background: #3d2b2b;
}

.pre-header .pre-dots span:nth-child(2) {
  background: #3d3b2b;
}

.pre-header .pre-dots span:nth-child(3) {
  background: #0c4040;
}

.t-kw {
  color: var(--acc);
}

.t-str {
  color: var(--olive);
}

.t-cmt {
  color: #3d7070;
  font-style: italic;
}

.t-fn {
  color: #c8e8e0;
}

.t-var {
  color: var(--text);
}

.code-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: .4rem;
}

.code-toolbar button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: .25rem .45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .8rem;
}

.code-lang {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: .2rem .45rem;
  color: #fff;
  font-size: .75rem;
}

/* ── 13. TABLE ────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 13px;
}

.post-content table,
.post-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th,
.post-content th,
.post-body th {
  background: color-mix(in srgb, var(--acc) 12%, var(--card));
  color: var(--acc);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid var(--brd);
  text-align: left;
  letter-spacing: 1px;
}

td,
.post-content td,
.post-body td {
  padding: 9px 14px;
  border: 1px solid var(--brd);
  color: var(--mut);
  vertical-align: top;
  word-break: break-word;
}

tr:nth-child(even) td {
  background: color-mix(in srgb, var(--acc) 3%, transparent);
}

/* ── 14. BLOCKQUOTE ──────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--acc);
  padding: 16px 20px;
  margin: 20px 0;
  background: color-mix(in srgb, var(--acc) 5%, transparent);
}

blockquote p {
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 0;
}

blockquote strong {
  color: var(--acc);
}

/* ── 15. SIDEBAR (new design) ────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 18px;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar-widget h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.sidebar-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.sidebar-author img.photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 10%;
  border: 2px solid color-mix(in srgb, var(--acc) 50%, transparent);
}

.sidebar-author .author-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-author .author-role {
  font-size: 11px;
  color: var(--mut);
}

.sidebar-author img.mvp {
  height: 32px;
  object-fit: contain;
}

.related-post {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brd) 40%, transparent);
  cursor: pointer;
}

.related-post:last-child {
  border-bottom: none;
}

.related-post:hover .rel-title {
  color: var(--acc);
}

.related-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.rel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  line-height: 1.4;
  transition: color var(--transition);
}

.rel-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-light);
  margin-top: 3px;
}

.sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brd) 40%, transparent);
  transition: color var(--transition);
  cursor: pointer;
}

.sidebar-cat:hover {
  color: var(--acc);
}

.sidebar-cat img {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.sidebar-cat .cat-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--acc);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  padding: 1px 7px;
}

/* Legacy sidebar (backward compat) */
.sidebar .widget {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 1rem;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar .widget h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 .6rem;
}

.sidebar .widget a.category,
.sidebar .widget a.tag {
  display: inline-block;
  background: color-mix(in srgb, var(--acc) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--acc) 25%, transparent);
  padding: .25rem .5rem;
  border-radius: 4px;
  margin: .2rem .2rem;
  color: var(--acc);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.sidebar .widget a.category:hover,
.sidebar .widget a.tag:hover {
  background: color-mix(in srgb, var(--acc) 18%, var(--card));
}

.avatar-sidebar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-sidebar img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  margin: 0 auto;
}

.widget.quick-links {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 10px;
  margin-bottom: 1rem;
}

.nav-icons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 1rem;
  padding: 10px;
}

.nav-icons-row .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--card);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 6px;
  transition: transform 0.2s ease;
}

.nav-icons-row .nav-icon:hover {
  transform: translateY(-2px);
}

.nav-icons-row .nav-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* ── 16. POSTS GRID + CARDS ──────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 2rem 0;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 18px;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
  text-decoration: none;
  display: block;
}

.post-card:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
}

.post-card-featured {
  border-left: 3px solid var(--acc);
}

.post-card h3,
.post-card .card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.post-card:hover h3,
.post-card:hover .card-title {
  color: var(--acc);
}

.post-card .card-meta,
.post-card .post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  margin-bottom: 8px;
}

.post-card .card-excerpt,
.post-card p {
  font-size: 13px;
  color: var(--mut);
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.post-card .card-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  padding: 2px 8px;
  display: inline-block;
  margin-top: 10px;
}

.post-card.search-hidden {
  display: none;
}

/* Index handoff layout */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.blog-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.post-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--brd);
}

.post-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
}

.post-card-meta .dot {
  color: var(--brd);
}

.post-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.post-card:hover .post-card-title {
  color: var(--acc);
}

.post-card-excerpt {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.65;
  flex: 1;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.post-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  border: 1px solid color-mix(in srgb, var(--brd) 60%, transparent);
  padding: 2px 8px;
}

.post-card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  border-left: 3px solid var(--acc);
}

.post-card-featured .post-card-img {
  height: 100%;
  min-height: 220px;
  border-bottom: none;
  border-right: 1px solid var(--brd);
}

.post-card-featured .post-card-body {
  padding: 28px 32px;
}

.post-card-featured .post-card-title {
  font-size: 17px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 2rem 0;
}

.pagination a,
.pagination .pg-current {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--brd);
  color: var(--mut);
  transition: border-color var(--transition), color var(--transition);
}

.pagination .page-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--brd);
  color: var(--mut);
  background: color-mix(in srgb, var(--acc) 4%, transparent);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.pagination a:hover {
  border-color: var(--acc);
  color: var(--acc);
}

.pagination .page-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 12%, transparent);
}

.pagination .pg-current {
  border-color: var(--acc);
  color: var(--acc);
}

.pagination .page-btn.active {
  border-color: var(--acc);
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
}

/* ── 17. HERO (index page) ───────────────────────────────── */
.hero {
  background: var(--bg-sec);
  border-bottom: 1px solid var(--brd);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 72px 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
}

.hero-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hero-prompt .ps-kw {
  color: #0d8a80;
  font-weight: 700;
}

.hero-prompt .ps-usr {
  color: var(--acc);
}

.hero-prompt .ps-pth {
  color: #2d5c58;
}

.hero-prompt .ps-cmd {
  color: var(--text);
}

.hero-prompt .cur {
  color: var(--acc);
  animation: blink 1.2s step-end infinite;
}

.hero-comment {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 .zt {
  color: var(--acc);
}

.hero h1 .sep {
  color: var(--mut);
}

.hero h1 .eng {
  color: var(--olive);
}

.hero-desc {
  font-size: 15px;
  color: var(--mut);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-bottom: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--acc);
}

.stat-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  letter-spacing: 1px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: filter var(--transition), background var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--acc);
  color: #040808;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--acc);
  color: var(--acc);
}

.btn-secondary:hover {
  background: var(--acc);
  color: #040808;
}

.hero-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.photo-frame {
  position: relative;
  width: 240px;
  overflow: visible;
}

.photo-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.photo-corners div {
  position: absolute;
  width: 18px;
  height: 18px;
}

.photo-corners .tl {
  top: -6px;
  left: -6px;
  border-top: 3px solid var(--acc);
  border-left: 3px solid var(--acc);
}

.photo-corners .tr {
  top: -6px;
  right: -6px;
  border-top: 3px solid var(--acc);
  border-right: 3px solid var(--acc);
}

.photo-corners .bl {
  bottom: -6px;
  left: -6px;
  border-bottom: 3px solid var(--acc);
  border-left: 3px solid var(--acc);
}

.photo-corners .br {
  bottom: -6px;
  right: -6px;
  border-bottom: 3px solid var(--acc);
  border-right: 3px solid var(--acc);
}

.photo-inner {
  position: relative;
  z-index: 1;
  width: 240px;
  height: 280px;
  overflow: hidden;
  background: #d7d7d7;
  border: 1.5px solid color-mix(in srgb, var(--acc) 50%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--acc) 18%, transparent), 3px 3px 0 var(--brd);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.photo-inner img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  object-position: 50% 5%;
}

.hero-dot-grid,
.hero-glow {
  position: absolute;
  pointer-events: none;
}

/* ── 18. INDEX SECTIONS ──────────────────────────────────── */
.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-sec);
  border-top: 1px solid var(--brd);
  border-bottom: 1px solid var(--brd);
}

.section-ps {
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.section-ps .ps {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #0d8a80;
  font-weight: 700;
}

.section-ps .usr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--acc);
}

.section-ps .pth {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #2d5c58;
}

.section-ps .cmd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
}

.section-rule {
  width: 100%;
  height: 1px;
  background: var(--brd);
  margin-top: 12px;
  flex-basis: 100%;
}

/* Category filter bar */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.cat-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--mut);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.cat-btn.active,
.cat-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* Search bar */
.search-bar-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--brd);
  background: var(--card);
  margin-bottom: 20px;
  transition: border-color var(--transition), background var(--transition);
}

.search-bar-wrap:focus-within {
  border-color: var(--acc);
}

.search-bar-prompt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--acc);
  padding: 10px 12px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--acc) 6%, var(--card));
  border-right: 1px solid var(--brd);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  padding: 10px 14px;
}

.search-input::placeholder {
  color: var(--mut);
}

.search-clear {
  background: transparent;
  border: none;
  border-left: 1px solid var(--brd);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  padding: 10px 14px;
  cursor: pointer;
}

.search-clear:hover {
  color: var(--acc);
}

.search-results-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  margin-bottom: 14px;
}

#searchCount {
  display: none;
}

.search-results-panel {
  display: none;
  margin-bottom: 18px;
  border: 1px solid var(--brd);
  background: color-mix(in srgb, var(--card) 92%, transparent);
}

.search-results-list {
  display: grid;
}

.search-result-item {
  display: block;
  padding: 9px 12px;
  border-bottom: 1px solid var(--brd);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: color-mix(in srgb, var(--acc) 8%, transparent);
  border-color: color-mix(in srgb, var(--acc) 35%, var(--brd));
}

.search-result-title {
  display: block;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.35;
}

.search-result-meta {
  display: block;
  margin-top: 4px;
  color: var(--mut);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

.search-results-empty,
.search-results-more {
  padding: 9px 12px;
  color: var(--mut);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.search-results-more {
  border-top: 1px solid var(--brd);
}

.search-results-more a {
  color: var(--acc);
}

/* ── 19. SHARE SECTION ───────────────────────────────────── */
.share-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--brd);
}

.share-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.share-buttons,
.share-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--mut);
  transition: border-color var(--transition), color var(--transition);
  cursor: pointer;
}

.share-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.post-nav-item {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 16px 18px;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.post-nav-item:hover {
  border-color: var(--acc);
}

.post-nav-item.prev {
  border-right: 3px solid var(--acc);
}

.post-nav-item.next {
  border-left: 3px solid var(--olive);
  text-align: right;
}

.post-nav-dir {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--mut);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.post-nav-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

/* ── 20. QUIZ WIDGET ─────────────────────────────────────── */
.quiz-question {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.5;
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-opt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--mut);
  text-align: left;
  transition: border-color var(--transition), color var(--transition);
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--acc);
  color: var(--acc);
}

.quiz-opt.correct {
  border-color: #44ee88;
  color: #44ee88;
}

.quiz-opt.wrong {
  border-color: #ff5566;
  color: #ff5566;
}

.quiz-result {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-top: 10px;
  display: none;
}

.quiz-result.show {
  display: block;
}

.quiz-result.correct-msg {
  color: #44ee88;
}

.quiz-result.wrong-msg {
  color: #ff5566;
}

.quiz-next-btn {
  display: none;
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--acc);
  color: var(--acc);
  letter-spacing: 1px;
}

.quiz-next-btn.show {
  display: inline-block;
}

.quiz-next-btn:hover {
  background: var(--acc);
  color: #040808;
}

/* Visitor counter */
.vis-counter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brd) 40%, transparent);
}

.vis-row .vis-val {
  color: var(--acc);
  font-weight: 700;
}

.vis-live {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #44ee88;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Email subscribe */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-input {
  background: var(--bg-sec);
  border: 1px solid var(--brd);
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
}

.email-input:focus {
  border-color: var(--acc);
}

.email-input::placeholder {
  color: var(--mut);
}

.subscribe-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 9px;
  background: var(--acc);
  color: #040808;
  border: none;
  letter-spacing: 1px;
}

.subscribe-btn:hover {
  filter: brightness(1.12);
}

#subscribeMsg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #44ee88;
  display: none;
}

/* Academy pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: border-color var(--transition), transform var(--transition);
}

.pricing-card:hover {
  border-color: var(--acc);
  transform: translateY(-3px);
}

.pricing-card.featured {
  border-color: var(--acc);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  background: var(--acc);
  color: #040808;
  padding: 3px 10px;
  letter-spacing: 1px;
  font-weight: 700;
}

.pricing-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--acc);
}

.price-per {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
}

.pricing-desc {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.65;
  min-height: 52px;
}

.pricing-stripe-btn {
  display: block;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 16px;
  background: var(--acc);
  color: #040808;
  border: none;
  cursor: pointer;
  margin-top: auto;
  letter-spacing: .5px;
  text-decoration: none;
  transition: filter var(--transition);
}

.pricing-stripe-btn:hover {
  filter: brightness(1.12);
}

.pricing-stripe-btn.outline {
  background: transparent;
  border: 1px solid var(--acc);
  color: var(--acc);
}

.pricing-stripe-btn.outline:hover {
  background: var(--acc);
  color: #040808;
}

.pricing-payment-icons {
  font-size: 10px;
  color: var(--mut);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.pricing-intro {
  text-align: center;
  margin-bottom: 36px;
}

.pricing-intro h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.pricing-intro p {
  font-size: 14px;
  color: var(--mut);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── 21. FOOTER ──────────────────────────────────────────── */
.footer {
  background: #040808;
  border-top: 2px solid var(--brd);
  padding: 40px 0 24px;
  transition: border-color var(--transition);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 52px;
}

.footer-col h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--acc);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-col p {
  font-size: 13px;
  color: #5a8888;
  line-height: 1.75;
  max-width: 380px;
}

.footer-col a {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #5a8888;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--acc);
}

.footer-col a .pref {
  color: var(--acc);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand img.photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 10%;
  border: 1.5px solid color-mix(in srgb, var(--acc) 40%, transparent);
}

.footer-brand img.mvp {
  height: 44px;
  object-fit: contain;
}

.footer-tags {
  padding-top: 20px;
  border-top: 1px solid #0d2020;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 52px;
  padding-right: 52px;
}

.footer-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #3d6a66;
  border: 1px solid #0d2828;
  padding: 4px 12px;
  transition: color var(--transition), border-color var(--transition);
}

.footer-tag:hover {
  color: var(--acc);
  border-color: var(--acc);
}

.footer-manage {
  text-align: center;
  padding: 18px 0 4px;
}

.footer-manage a {
  display: inline-block;
  padding: 7px 22px;
  border: 1px solid color-mix(in srgb, var(--acc) 30%, var(--brd));
  color: var(--mut);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}

.footer-manage a:hover {
  color: var(--acc);
  border-color: var(--acc);
}

.footer-bottom {
  border-top: 1px solid #193d3d;
  padding-top: 20px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #3a6a6a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 52px;
  padding-right: 52px;
}

.site-footer {
  display: none;
}

/* ── 22. NEWSLETTER POPUP ────────────────────────────────── */
.newsletter-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.newsletter-popup-overlay.show {
  display: flex;
}

.newsletter-popup {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  position: relative;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--mut);
  font-size: 20px;
  cursor: pointer;
}

.popup-close:hover {
  color: var(--acc);
}

.popup-content {
  text-align: center;
}

.popup-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.popup-content h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.popup-content p {
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 20px;
}

.newsletter-form-popup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-form-popup input[type="email"] {
  background: var(--bg-sec);
  border: 1px solid var(--brd);
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  padding: 10px 14px;
}

.newsletter-form-popup input[type="email"]:focus {
  border-color: var(--acc);
}

.newsletter-btn-popup {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 11px;
  background: var(--acc);
  color: #040808;
  border: none;
  cursor: pointer;
}

.newsletter-btn-popup:hover {
  filter: brightness(1.1);
}

.popup-no-thanks {
  background: transparent;
  border: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  margin-top: 12px;
  cursor: pointer;
}

.popup-no-thanks:hover {
  color: var(--acc);
}

.newsletter-message-popup {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #44ee88;
  margin-top: 10px;
}

/* ── 23. MISC LEGACY ─────────────────────────────────────── */
.intro-block {
  max-width: var(--max-width);
  margin: 0 auto 8px auto;
}

.mission-statement {
  background: var(--bg-sec);
  border-top: 1px solid var(--brd);
  border-bottom: 1px solid var(--brd);
  padding: 2rem 0;
}

.mission-content {
  max-width: 760px;
}

.mission-content h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.mission-content p {
  font-size: 14px;
  color: var(--mut);
  line-height: 1.75;
  margin-bottom: 14px;
}

.mission-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.mission-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--acc);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  padding: 3px 10px;
}

.community-impact-widget {
  background: var(--card);
  border: 1px solid var(--brd);
  padding: 20px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.impact-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 700;
  color: var(--acc);
}

.impact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mut);
  margin-top: 6px;
}

.impact-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--brd);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Nav brand (hidden in new design) */
.nav-brand a {
  visibility: hidden;
}

.navbar,
.nav-links {
  display: none;
}

/* ── 24. ANIMATIONS ──────────────────────────────────────── */
@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: .5;
    transform: scale(.8)
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 25. RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1200px) {
  .post-wrapper {
    grid-template-columns: 180px 1fr 240px;
    gap: 28px;
    padding: 36px 32px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1023px) {
  .post-wrapper {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }

  .post-toc,
  .post-sidebar {
    position: static;
  }

  .post-toc {
    display: none;
  }

  .post-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .layout-with-sidebar {
    display: block;
  }

  .post-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    width: 100%;
    flex: none;
    margin-top: 1rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding: 48px 32px;
  }

  .hero-photo {
    display: none;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }

  .post-card-featured {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    align-items: stretch;
  }

  .post-card-featured .post-card-img {
    display: block;
    width: 100%;
    height: 220px !important;
    min-height: 220px;
    max-height: 220px;
    flex: 0 0 220px;
    object-fit: cover;
    object-position: center;
    align-self: stretch;
    border-right: none;
    border-bottom: 1px solid var(--brd);
  }

  .post-card-featured .post-card-body {
    position: relative;
    z-index: 1;
    background: var(--card);
  }

  .layout-with-sidebar .main-col .post-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .layout-with-sidebar .main-col .post-layout .post-toc {
    position: static;
  }

  .layout-with-sidebar .sidebar {
    width: 100%;
    flex: none;
  }
}

@media (max-width: 767px) {

  .seg4,
  .seg5 {
    display: none;
  }

  .seg1 {
    clip-path: none;
    padding: 0 16px;
  }

  .nav-right .nav-link {
    display: none;
  }

  .spec-row .spec-item,
  .spec-row .dot {
    display: none;
  }

  .spec-row .spec-item:first-of-type {
    display: inline;
  }

  .breadcrumb {
    padding: 0 20px;
  }

  .post-wrapper {
    padding: 20px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
  }

  .footer-tags {
    padding: 20px 20px 0;
  }

  .footer-bottom {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-grid {
    padding: 36px 20px;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .post-card-featured .post-card-body {
    padding: 18px 20px;
  }

  .post-card-featured .post-card-img {
    height: 180px !important;
    min-height: 180px;
    max-height: 180px;
    flex-basis: 180px;
  }
}