/* Page structure and components: header and navigation, heroes, sections, cards, chips,
 * post header and navigation, call to action and footer. Loaded after base.css. */

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(13, 17, 36, 0.07);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
}
.brand {
  flex-shrink: 0;
  margin-right: auto;
}
.brand img {
  width: 170px;
  height: auto;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.94rem;
  font-weight: 550;
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.nav-link:hover,
.has-menu:focus-within > .nav-link {
  color: var(--ink);
  background: var(--surface-soft);
}
.nav-item.active > .nav-link {
  color: var(--brand-700);
  background: var(--brand-50);
}
.chevron {
  transition: transform 0.2s;
}

/* "Browse" menu */
.menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
  width: 520px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.menu::before {
  /* keeps the menu open while the pointer crosses the gap */
  content: "";
  position: absolute;
  inset: -12px 0 auto;
  height: 12px;
}
.has-menu:hover > .menu,
.has-menu:focus-within > .menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.has-menu:hover .chevron,
.has-menu:focus-within .chevron {
  transform: rotate(180deg);
}
.menu-col {
  padding: 6px;
}
.menu-col + .menu-col {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.menu-heading {
  margin: 4px 8px 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.menu-item:hover,
.menu-item.active {
  color: var(--ink);
  background: var(--surface-soft);
}
.menu-item-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}
.menu-item-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.platform-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  background: var(--dot, var(--brand-700));
  border-radius: 3px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--brand-700)) 18%, transparent);
}

/* Narrow screens: the menu toggle */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nav-toggler {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border-radius: 999px;
  cursor: pointer;
}
.nav-toggler span,
.nav-toggler span::before,
.nav-toggler span::after {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s, top 0.2s, background-color 0.2s;
}
.nav-toggler span {
  top: 21px;
}
.nav-toggler span::before,
.nav-toggler span::after {
  content: "";
  left: 0;
}
.nav-toggler span::before {
  top: -6px;
}
.nav-toggler span::after {
  top: 6px;
}
.nav-toggle:checked + .nav-toggler span {
  background: transparent;
}
.nav-toggle:checked + .nav-toggler span::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle:checked + .nav-toggler span::after {
  top: 0;
  transform: rotate(-45deg);
}
.nav-toggle:focus-visible + .nav-toggler {
  outline: 2px solid var(--brand-500);
}

@media (max-width: 900px) {
  .nav-toggler {
    display: block;
  }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 12px var(--gutter) 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle:checked ~ .main-nav {
    display: flex;
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-link {
    display: flex;
    padding: 12px 14px;
    font-size: 1rem;
  }
  .has-menu > .nav-link {
    display: none;
  }
  .menu-col:first-child ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .chevron {
    display: none;
  }
  .menu {
    position: static;
    grid-template-columns: 1fr;
    width: auto;
    padding: 0 0 8px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .menu-col + .menu-col {
    border-left: 0;
    padding-left: 6px;
  }
  .menu-col:last-child ul {
    display: flex;
    flex-wrap: wrap;
  }
  .menu-col:last-child .menu-item-title {
    font-weight: 550;
  }
  .nav-list > .nav-item:not(.has-menu) {
    border-top: 1px solid var(--line);
  }
  .nav-cta {
    min-height: 46px;
  }
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section {
  padding-block: clamp(56px, 7vw, 96px);
}
.section-tight {
  padding-block: clamp(32px, 4vw, 48px) clamp(56px, 7vw, 96px);
}
.section-flush {
  padding-top: 0;
}
.section-strip {
  padding-block: clamp(28px, 4vw, 40px) 0;
}
.section-soft {
  background: var(--surface-soft);
  border-block: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.section-head .eyebrow {
  margin-bottom: 10px;
}
.section-lead {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
}
.section-link {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}
.strip-label {
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Home hero ──────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 85% 20%, rgba(214, 58, 224, 0.12), transparent 60%),
    radial-gradient(50% 70% at 10% 0%, rgba(100, 33, 212, 0.1), transparent 60%),
    var(--surface-tint);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  /* a faint diagram grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100, 33, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 33, 212, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(80% 90% at 70% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 90% at 70% 40%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding-block: clamp(56px, 8vw, 104px);
}
.hero-text .eyebrow {
  padding: 6px 12px 6px 10px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(214, 58, 224, 0.18);
}
.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.4rem);
  font-weight: 800;
}
.hero .lead {
  max-width: 560px;
  margin-top: 24px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero-stats {
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  margin: 40px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
}
.hero-stats dt {
  font-size: 0.85rem;
  color: var(--muted);
}
.hero-stats dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* The ER diagram next to the headline, in a modeling-tool window */
.hero-visual {
  position: relative;
  justify-self: end;
  width: min(100%, 560px);
}
.hero-visual::before {
  /* glow behind the window */
  content: "";
  position: absolute;
  inset: 10% 6% -4% 10%;
  background: var(--gradient);
  border-radius: 40%;
  filter: blur(60px);
  opacity: 0.28;
}
.hero-window {
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 17, 36, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
}
.hero-window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}
.hero-window-bar .badge {
  margin-left: auto;
  font-family: var(--font-sans);
}
.window-dots {
  width: 10px;
  height: 10px;
  margin-right: 32px;
  background: #ff5f57;
  border-radius: 50%;
  box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
}
.hero-window-canvas {
  padding: clamp(18px, 3vw, 32px);
  background-image: radial-gradient(rgba(100, 33, 212, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ── Schema illustration (SchemaArt.astro) ──────────────────────────────── */

.schema-art {
  container-type: inline-size;
  position: relative;
  width: 100%;
}
.schema-canvas {
  --u: calc(100cqw / var(--canvas-w));
  position: absolute;
  inset: 0;
}
.schema-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: color-mix(in srgb, var(--accent-color) 55%, white);
}
.schema-links path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
  animation: schema-flow 1.6s linear infinite;
}
.schema-links circle {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.schema-links circle.many {
  fill: currentColor;
}
.schema-table {
  position: absolute;
  overflow: hidden;
  font-size: calc(var(--text) * var(--u));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(10 * var(--u));
  box-shadow: 0 1px 2px rgba(13, 17, 36, 0.05), 0 12px 28px -14px rgba(44, 13, 99, 0.35);
}
.schema-table-name {
  display: flex;
  align-items: center;
  gap: 0.55em;
  height: calc(var(--head) * var(--u));
  padding: 0 calc(12 * var(--u));
  font-family: var(--font-mono);
  font-weight: 500;
  color: #fff;
  background: var(--accent-color);
}
.schema-table-name svg {
  opacity: 0.75;
}
.schema-table ul {
  margin: 0;
  padding: calc(var(--pad) * var(--u)) 0;
  list-style: none;
}
.schema-table li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: calc(var(--row) * var(--u));
  padding: 0 calc(12 * var(--u));
  font-family: var(--font-mono);
  color: var(--ink);
  white-space: nowrap;
}
.schema-col {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schema-table em {
  margin-left: auto;
  padding-left: 0.5em;
  font-style: normal;
  color: var(--muted);
}
.schema-table .key {
  flex-shrink: 0;
  width: 2.3em;
  padding: 0.1em 0;
  font-size: 0.72em;
  font-weight: 700;
  text-align: center;
  border-radius: 0.35em;
}
.key.pk {
  color: #92400e;
  background: #fef3c7;
}
.key.fk {
  color: var(--brand-800);
  background: var(--brand-100);
}
.schema-art-hero .schema-table:nth-of-type(even) .schema-table-name {
  background: linear-gradient(90deg, #a52fe4, var(--accent));
}
@keyframes schema-flow {
  to {
    stroke-dashoffset: -22;
  }
}

/* ── Page hero (listings, info pages) ───────────────────────────────────── */

.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(50% 90% at 90% 10%, rgba(214, 58, 224, 0.1), transparent 60%),
    var(--surface-tint);
  border-bottom: 1px solid var(--line);
}
.page-hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding-top: clamp(32px, 5vw, 56px);
}
.page-hero-text {
  padding-bottom: clamp(40px, 6vw, 72px);
}
.page-hero .eyebrow {
  margin-bottom: 14px;
}
.page-hero h1 {
  max-width: 16ch;
}
.page-hero .lead {
  max-width: 620px;
  margin-top: 18px;
}
.page-hero-art {
  position: relative;
  align-self: center;
  width: clamp(260px, 30vw, 380px);
  padding-block: 32px;
}
.page-hero-art::before {
  content: "";
  position: absolute;
  inset: 20% 10%;
  background: var(--hero-accent, var(--brand-700));
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.18;
}
.hero-count {
  display: inline-block;
  margin-top: 22px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand-800);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 999px;
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */

.breadcrumbs {
  margin-bottom: 22px;
  font-size: 0.85rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.breadcrumbs li + li::before {
  content: "/";
  color: var(--line-strong);
}
.breadcrumbs a {
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--brand-700);
}
.breadcrumbs [aria-current] {
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

/* ── Chips and badges ───────────────────────────────────────────────────── */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}
.chip-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.chip.active .chip-count {
  color: rgba(255, 255, 255, 0.7);
}
.chip-sm {
  padding: 4px 11px;
  font-size: 0.8rem;
}
.chip-sm .platform-dot {
  width: 8px;
  height: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--badge);
  background: color-mix(in srgb, var(--badge) 10%, white);
  border: 1px solid color-mix(in srgb, var(--badge) 22%, white);
  border-radius: 6px;
}

/* ── Platform cards (home) ──────────────────────────────────────────────── */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.platform-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.platform-card:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--dot) 45%, white);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.platform-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: var(--dot);
  border-radius: 10px;
}
.platform-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.platform-name {
  font-weight: 650;
  line-height: 1.3;
}
.platform-count {
  font-size: 0.8rem;
  color: var(--muted);
}
.platform-arrow {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s, color 0.15s;
}
.platform-card:hover .platform-arrow {
  color: var(--dot);
  transform: translateX(3px);
}

/* ── Post cards ─────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 24px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}
.card-model .card-media img,
.card-diagram .card-media img {
  padding: 12px 12px 0;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}
.card:hover .card-media img {
  transform: scale(1.03);
}
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.card-title {
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.card-title a {
  color: var(--ink);
}
.card-title a::after {
  /* the whole card is the link */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-title a:focus-visible {
  outline: none;
}
.card:has(.card-title a:focus-visible) {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
}
.card-excerpt {
  display: -webkit-box;
  margin-top: 10px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-more {
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-700);
}
.card-more .arrow {
  display: inline-block;
  transition: transform 0.15s;
}
.card:hover .card-more .arrow {
  transform: translateX(4px);
}

/* The newest article on the blog page */
.card-featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  margin-bottom: 32px;
}
.card-featured .card-media {
  position: relative;
  aspect-ratio: auto;
  min-height: 340px;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}
.card-featured .card-media img {
  position: absolute;
  inset: 0;
}
.card-featured .card-body {
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
}
.card-featured .card-title {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  line-height: 1.2;
}
.card-featured .card-excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}

/* ── Post header and body ───────────────────────────────────────────────── */

.post-header {
  padding-block: clamp(32px, 5vw, 56px) clamp(32px, 4vw, 48px);
  background:
    radial-gradient(50% 120% at 100% 0%, rgba(214, 58, 224, 0.08), transparent 60%),
    var(--surface-tint);
  border-bottom: 1px solid var(--line);
}
.post-header .container,
.post-nav {
  max-width: calc(720px + 2 * var(--gutter));
}
.post-header.wide .container {
  max-width: calc(var(--container) + 2 * var(--gutter));
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.post-header h1 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.post-meta span + span::before {
  content: "·";
  margin-right: 18px;
  color: var(--line-strong);
}

.post-body {
  padding-block: clamp(40px, 5vw, 64px);
}
.post-body.has-toc {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  max-height: calc(100vh - var(--header-height) - 64px);
  overflow-y: auto;
  font-size: 0.86rem;
}
.toc-heading {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}
.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  line-height: 1.4;
  color: var(--text);
  border-left: 2px solid transparent;
}
.toc a:hover {
  color: var(--brand-700);
  border-left-color: var(--brand-500);
}

/* Previous / next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: clamp(48px, 6vw, 80px);
}
.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-nav-link:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow);
}
.post-nav-link.next {
  text-align: right;
}
.post-nav-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.post-nav-title {
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
}

/* ── Call to action ─────────────────────────────────────────────────────── */

.cta-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 56px);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.85);
  background: var(--gradient);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
}
.cta-band > * {
  position: relative;
}
.cta-band h2 {
  color: #fff;
}
.cta-band p {
  max-width: 520px;
  margin-top: 10px;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn-light {
  color: var(--brand-800);
  background: #fff;
}
.btn-light:hover {
  color: var(--brand-900);
}
.btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-outline-light:hover {
  color: #fff;
  border-color: #fff;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  color: rgba(255, 255, 255, 0.65);
  background: var(--ink);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-block: 64px 48px;
}
.footer-brand img {
  width: 170px;
}
.footer-brand p {
  max-width: 340px;
  margin-top: 16px;
  line-height: 1.6;
}
.footer-cta {
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
  color: #e9b8ff;
}
.footer-cta:hover {
  color: #fff;
}
.footer-heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer li + li {
  margin-top: 8px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.78);
}
.site-footer a:hover {
  color: #fff;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
  font-size: 0.84rem;
  background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    justify-self: stretch;
    width: 100%;
    max-width: 560px;
  }
  .post-body.has-toc {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 18px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .card-featured {
    grid-template-columns: 1fr;
  }
  .card-featured .card-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-hero-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .page-hero-art {
    display: none;
  }
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .platform-arrow {
    display: none;
  }
  .platform-card {
    gap: 10px;
    padding: 12px;
  }
  .platform-mark {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }
  .platform-name {
    font-size: 0.92rem;
  }
  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav-link.next {
    text-align: left;
  }
  .post-meta {
    gap: 4px 16px;
  }
  .post-meta span + span::before {
    display: none;
  }
  .hero-stats dd {
    font-size: 1.6rem;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .schema-links path {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ── How it works (home) ────────────────────────────────────────────────── */

.section-head-center {
  justify-content: center;
  text-align: center;
}
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps::before {
  /* the line joining the steps */
  content: "";
  position: absolute;
  top: 28px;
  left: 16%;
  right: 16%;
  border-top: 2px dashed var(--brand-200);
}
.step {
  position: relative;
  padding: 0 12px;
  text-align: center;
  counter-increment: step;
}
.step-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  color: #fff;
  background: var(--gradient);
  border-radius: 16px;
  box-shadow: 0 0 0 8px var(--surface), 0 12px 24px -10px rgba(100, 33, 212, 0.6);
}
.step-icon::after {
  content: counter(step);
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--brand-800);
  background: var(--surface);
  border: 1px solid var(--brand-200);
  border-radius: 50%;
}
.step-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step h3 {
  font-size: 1.15rem;
}
.step p {
  max-width: 320px;
  margin: 10px auto 0;
  color: var(--muted);
}

/* ── Post header actions ────────────────────────────────────────────────── */

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ── 404 ────────────────────────────────────────────────────────────────── */

.not-found .page-hero-inner {
  min-height: calc(100vh - var(--header-height) - 320px);
  align-items: center;
}
.not-found .page-hero-text {
  padding-block: clamp(48px, 8vw, 96px);
}

@media (max-width: 720px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .steps::before {
    top: 28px;
    bottom: 28px;
    left: 50%;
    right: auto;
    border-top: 0;
    border-left: 2px dashed var(--brand-200);
  }
  .step p {
    padding: 8px 12px;
    background: var(--surface);
  }
}
.section-steps + .section {
  padding-top: 0;
}

/* ── License of an open-source system ───────────────────────────────────── */

.card-license {
  margin-left: auto;
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.license-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}
.license-banner svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #b45309;
}
.license-banner strong {
  color: #92400e;
}
