/*
 * SPACEREX site theme — layered on top of Bootstrap 5.
 * Brand colours come from the logo: navy #22245F, cyan #38C1CF.
 */

/* ------------------------------------------------------------------ */
/* Fonts (self-hosted, OFL — see assets/fonts/*-OFL.txt)               */
/* ------------------------------------------------------------------ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-italic.0a81fe197e0d.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2");
}

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
  --sr-navy: #22245f;
  --sr-navy-dark: #181a47;
  --sr-navy-deep: #10112f;
  --sr-cyan: #38c1cf;
  --sr-cyan-soft: #e3f6f8;
  --sr-cyan-ink: #0e6c76;

  --sr-ink: #16183a;
  --sr-text: #2e3150;
  --sr-muted: #5d6180;
  --sr-border: #e4e6ef;
  --sr-surface: #f5f6fa;
  --sr-surface-2: #eceef6;

  --sr-radius-sm: 8px;
  --sr-radius: 12px;
  --sr-radius-lg: 20px;
  --sr-shadow-sm: 0 1px 2px rgba(22, 24, 58, 0.06);
  --sr-shadow: 0 1px 2px rgba(22, 24, 58, 0.05), 0 8px 24px -8px rgba(22, 24, 58, 0.14);
  --sr-shadow-lg: 0 2px 4px rgba(22, 24, 58, 0.05), 0 20px 40px -12px rgba(22, 24, 58, 0.22);

  --sr-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sr-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sr-header-height: 68px;
  --sr-prose-width: 740px;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--sr-font-sans);
  --bs-font-monospace: var(--sr-font-mono);
  --bs-body-color: var(--sr-text);
  --bs-body-color-rgb: 46, 49, 80;
  --bs-body-bg: #ffffff;
  --bs-emphasis-color: var(--sr-ink);
  --bs-heading-color: var(--sr-ink);
  --bs-secondary-color: var(--sr-muted);
  --bs-border-color: var(--sr-border);
  --bs-primary: var(--sr-navy);
  --bs-primary-rgb: 34, 36, 95;
  --bs-link-color: var(--sr-navy);
  --bs-link-color-rgb: 34, 36, 95;
  --bs-link-hover-color: var(--sr-cyan-ink);
  --bs-link-hover-color-rgb: 14, 108, 118;
  --bs-code-color: var(--sr-navy);
  --bs-border-radius: var(--sr-radius-sm);
  --bs-border-radius-lg: var(--sr-radius);
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

html {
  scroll-padding-top: calc(var(--sr-header-height) + 16px);
}

body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

::selection {
  background: rgba(56, 193, 207, 0.28);
}

:focus-visible {
  outline: 3px solid var(--sr-cyan);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 8px 14px;
  border-radius: var(--sr-radius-sm);
  background: var(--sr-navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1.1rem;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-lg {
  --bs-btn-padding-x: 1.4rem;
  --bs-btn-padding-y: 0.7rem;
  --bs-btn-font-size: 1rem;
}

.btn-primary {
  --bs-btn-bg: var(--sr-navy);
  --bs-btn-border-color: var(--sr-navy);
  --bs-btn-hover-bg: var(--sr-navy-dark);
  --bs-btn-hover-border-color: var(--sr-navy-dark);
  --bs-btn-active-bg: var(--sr-navy-deep);
  --bs-btn-active-border-color: var(--sr-navy-deep);
  --bs-btn-focus-shadow-rgb: 56, 193, 207;
}

.btn-outline-primary {
  --bs-btn-color: var(--sr-navy);
  --bs-btn-border-color: #cfd2e3;
  --bs-btn-hover-color: var(--sr-navy);
  --bs-btn-hover-bg: var(--sr-surface);
  --bs-btn-hover-border-color: var(--sr-navy);
  --bs-btn-active-color: var(--sr-navy);
  --bs-btn-active-bg: var(--sr-surface-2);
  --bs-btn-active-border-color: var(--sr-navy);
  --bs-btn-focus-shadow-rgb: 56, 193, 207;
  background: #fff;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--sr-cyan-soft);
  color: var(--sr-cyan-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

a.eyebrow:hover {
  background: #d0eff2;
  color: var(--sr-cyan-ink);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.dev-banner {
  padding: 0.35rem 1rem;
  background: #fff3cd;
  border-bottom: 1px solid #ffda6a;
  color: #664d03;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--sr-border);
}

.site-header .navbar {
  min-height: var(--sr-header-height);
  padding-top: 0;
  padding-bottom: 0;
}

.site-header .navbar-brand img {
  display: block;
  height: 34px;
  width: auto;
}

.site-header .navbar-toggler {
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-sm);
  padding: 0.4rem 0.55rem;
}

.site-header .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(56, 193, 207, 0.4);
}

.site-nav .nav-link {
  position: relative;
  padding: 0.5rem 0.9rem !important;
  border-radius: var(--sr-radius-sm);
  color: var(--sr-text);
  font-weight: 500;
}

.site-nav .nav-link:hover {
  color: var(--sr-navy);
  background: var(--sr-surface);
}

.site-nav .nav-link.active {
  color: var(--sr-navy);
  font-weight: 600;
}

@media (min-width: 768px) {
  .site-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: -13px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--sr-cyan);
  }
}

@media (max-width: 767.98px) {
  .site-header .navbar-collapse {
    padding: 0.5rem 0 1rem;
  }

  .site-header .header-cta {
    margin-top: 0.5rem;
  }
}

/* ------------------------------------------------------------------ */
/* Home hero                                                           */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 4rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(56, 193, 207, 0.16), transparent 60%),
    radial-gradient(40rem 24rem at -10% 110%, rgba(34, 36, 95, 0.08), transparent 60%),
    linear-gradient(180deg, #f7f8fc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--sr-border);
}

.hero h1 {
  margin: 1.1rem 0 1rem;
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero h1 .accent {
  color: var(--sr-cyan-ink);
}

.hero .lead {
  max-width: 34rem;
  margin-bottom: 2rem;
  color: var(--sr-muted);
  font-size: 1.1875rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-art::before {
  content: "";
  position: absolute;
  width: 82%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 193, 207, 0.22) 0%, rgba(56, 193, 207, 0) 70%);
}

.hero-art img {
  position: relative;
  width: min(100%, 340px);
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(34, 36, 95, 0.25));
}

@media (max-width: 991.98px) {
  .hero {
    padding: 3rem 0;
  }
}

/* ------------------------------------------------------------------ */
/* Post cards                                                          */
/* ------------------------------------------------------------------ */

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius);
  background: #fff;
  box-shadow: var(--sr-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: #d5d8e6;
  box-shadow: var(--sr-shadow-lg);
}

.post-card:focus-within {
  border-color: var(--sr-cyan);
}

.post-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sr-surface);
}

.post-media picture,
.post-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.post-media img {
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-media.is-contained {
  background: #fff;
  border-bottom: 1px solid var(--sr-border);
}

.post-media.is-contained img {
  padding: 1.25rem;
  object-fit: contain;
}

.post-card:hover .post-media img {
  transform: scale(1.03);
}

.post-media-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--sr-surface);
}

.post-media-placeholder img {
  width: 28%;
  height: auto;
  object-fit: contain;
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem 1.35rem 1.35rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  color: var(--sr-muted);
  font-size: 0.8125rem;
}

.post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.post-card .post-meta {
  margin-bottom: 0.7rem;
}

.post-category {
  color: var(--sr-cyan-ink);
  font-weight: 600;
}

.post-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.post-card-title a {
  color: var(--sr-ink);
  text-decoration: none;
}

.post-card-title a::after {
  /* Make the whole card clickable. */
  content: "";
  position: absolute;
  inset: 0;
}

.post-card:hover .post-card-title a {
  color: var(--sr-navy);
}

.post-card-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--sr-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Featured (newest) post on the home page */

.post-card.is-featured {
  display: grid;
  grid-template-columns: 1fr;
}

.post-card.is-featured .post-card-body {
  justify-content: center;
  padding: 1.5rem 1.5rem 1.75rem;
}

.post-card.is-featured .post-card-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.post-card.is-featured .post-card-text {
  font-size: 1.0625rem;
  -webkit-line-clamp: 4;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  color: var(--sr-navy);
  font-weight: 600;
}

.read-more .icon {
  transition: transform 0.18s ease;
}

.post-card:hover .read-more .icon {
  transform: translateX(3px);
}

@media (min-width: 992px) {
  .post-card.is-featured {
    grid-template-columns: 7fr 5fr;
  }

  .post-card.is-featured .post-media {
    aspect-ratio: auto;
    min-height: 360px;
  }

  .post-card.is-featured .post-card-body {
    padding: 2.5rem;
  }
}

/* ------------------------------------------------------------------ */
/* Page headers (index pages, general pages, 404)                      */
/* ------------------------------------------------------------------ */

.page-header {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, #f7f8fc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--sr-border);
}

.page-header h1 {
  margin: 0.9rem 0 0;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-header .lead {
  max-width: 42rem;
  margin: 0.9rem 0 0;
  color: var(--sr-muted);
}

.page-header .prose > :first-child {
  margin-top: 0.9rem;
}

.page-header .prose p {
  color: var(--sr-muted);
  font-size: 1.125rem;
}

/* ------------------------------------------------------------------ */
/* Article                                                             */
/* ------------------------------------------------------------------ */

.article-header {
  padding: 3rem 0 0;
}

.article-header h1 {
  margin: 1rem 0 0.9rem;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.article-subtitle {
  margin: 0 0 1.25rem;
  color: var(--sr-muted);
  font-size: 1.25rem;
  line-height: 1.5;
}

.article-header .post-meta {
  font-size: 0.9375rem;
}

.article-hero {
  margin: 2rem 0 0;
  overflow: hidden;
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-lg);
  background: var(--sr-surface);
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.article-hero.is-contained {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #fff;
}

.article-hero.is-contained img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
}

@media (max-width: 575.98px) {
  .article-hero.is-contained {
    padding: 1.5rem;
  }

  .article-hero.is-contained img {
    max-height: 200px;
  }
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--sr-prose-width));
  justify-content: center;
  gap: 4rem;
  padding: 0 0 4rem;
}

@media (min-width: 1200px) {
  .post-layout.has-toc {
    grid-template-columns: minmax(0, var(--sr-prose-width)) 240px;
  }
}

.affiliate-note {
  display: flex;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid #f1e3b5;
  border-radius: var(--sr-radius);
  background: #fffaeb;
  color: #6b5516;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.affiliate-note .icon {
  margin-top: 0.2rem;
  font-size: 1.05rem;
}

.article-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--sr-border);
}

.related-links {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--sr-radius);
  background: var(--sr-surface);
}

.related-links h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.related-links ul {
  margin: 0;
  padding-left: 1.1rem;
}

.related-links li + li {
  margin-top: 0.35rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}

.more-posts {
  padding: 3.5rem 0 4rem;
  background: var(--sr-surface);
  border-top: 1px solid var(--sr-border);
}

/* ------------------------------------------------------------------ */
/* Table of contents                                                   */
/* ------------------------------------------------------------------ */

.toc {
  font-size: 0.875rem;
}

.toc-title {
  margin: 0 0 0.75rem;
  color: var(--sr-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  border-left: 2px solid var(--sr-border);
  color: var(--sr-muted);
  line-height: 1.4;
  text-decoration: none;
}

.toc a.is-sub {
  padding-left: 1.7rem;
  font-size: 0.8125rem;
}

.toc a:hover {
  color: var(--sr-navy);
}

.toc a.active {
  border-left-color: var(--sr-cyan);
  color: var(--sr-navy);
  font-weight: 600;
}

.toc-aside {
  display: none;
}

@media (min-width: 1200px) {
  .toc-aside {
    display: block;
  }

  .toc-aside .toc {
    position: sticky;
    top: calc(var(--sr-header-height) + 2.5rem);
    max-height: calc(100vh - var(--sr-header-height) - 5rem);
    overflow-y: auto;
  }
}

.toc-inline {
  margin: 2rem 0 0;
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius);
  background: #fff;
}

.toc-inline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  color: var(--sr-ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.toc-inline summary::-webkit-details-marker {
  display: none;
}

.toc-inline summary .icon {
  transition: transform 0.18s ease;
}

.toc-inline[open] summary .icon {
  transform: rotate(180deg);
}

.toc-inline .toc {
  padding: 0 1.1rem 1rem;
}

@media (min-width: 1200px) {
  .has-toc .toc-inline {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Prose (StreamField content)                                         */
/* ------------------------------------------------------------------ */

.prose {
  color: var(--sr-text);
  font-size: 1.0625rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.prose > .block-paragraph_block > :first-child,
.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose li::marker {
  color: var(--sr-muted);
}

.prose h2 {
  margin: 3rem 0 1rem;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
}

.prose h3 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.3125rem;
}

.prose h4 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
}

.prose a {
  color: var(--sr-navy);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--sr-cyan);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--sr-cyan-ink);
}

.prose strong,
.prose b {
  color: var(--sr-ink);
  font-weight: 650;
}

.prose :not(pre) > code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--sr-border);
  border-radius: 6px;
  background: var(--sr-surface);
  color: var(--sr-navy);
  font-size: 0.875em;
  word-break: break-word;
}

.prose hr {
  margin: 2.5rem 0;
  border-color: var(--sr-border);
  opacity: 1;
}

.prose figure {
  margin: 2rem 0;
}

.prose figure img,
.prose .richtext-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius);
}

.prose figcaption {
  margin-top: 0.7rem;
  color: var(--sr-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.prose .richtext-image.left {
  float: left;
  max-width: 50%;
  margin: 0.35rem 1.5rem 1rem 0;
}

.prose .richtext-image.right {
  float: right;
  max-width: 50%;
  margin: 0.35rem 0 1rem 1.5rem;
}

.prose .richtext-image.full-width {
  display: block;
  width: 100%;
  margin: 2rem 0;
}

.prose blockquote,
.prose .pullquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 4px solid var(--sr-cyan);
  color: var(--sr-ink);
  font-size: 1.1875rem;
  line-height: 1.6;
}

.prose .pullquote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}

.prose .pullquote blockquote p:last-child {
  margin-bottom: 0;
}

.prose .pullquote figcaption {
  margin-top: 0.6rem;
  color: var(--sr-muted);
  font-size: 0.9375rem;
  text-align: left;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--sr-border);
  text-align: left;
  vertical-align: top;
}

.prose thead th,
.prose tr:first-child th {
  color: var(--sr-ink);
  font-weight: 650;
  background: var(--sr-surface);
}

.prose .block-embed_block,
.prose .block-youtube_block,
.prose .block-youtube_video {
  margin: 2rem 0;
}

.prose .responsive-object {
  overflow: hidden;
  border-radius: var(--sr-radius);
  background: var(--sr-navy-deep);
  box-shadow: var(--sr-shadow);
}

.prose .block-heading_image_block {
  margin: 3rem 0 1.5rem;
}

.heading-image {
  display: grid;
  align-items: center;
  gap: 1.5rem;
}

.heading-image h2 {
  margin: 0;
}

.heading-image figure {
  margin: 0;
}

@media (min-width: 768px) {
  .heading-image {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ------------------------------------------------------------------ */
/* Code blocks                                                         */
/* ------------------------------------------------------------------ */

.code-block {
  margin: 1.75rem 0;
  overflow: hidden;
  border: 1px solid #1f2430;
  border-radius: var(--sr-radius);
  background: #0d1117;
  box-shadow: var(--sr-shadow);
}

.prose .code-block {
  margin: 1.75rem 0;
}

.code-block-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  margin: 0;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  border-bottom: 1px solid #262c38;
  background: #161b22;
  color: #c9d1d9;
  font-family: var(--sr-font-mono);
  font-size: 0.8125rem;
  text-align: left;
}

.prose .code-block-header {
  margin: 0;
  color: #c9d1d9;
  font-size: 0.8125rem;
  text-align: left;
}

.code-block-dots {
  display: inline-flex;
  gap: 6px;
}

.code-block-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a404b;
}

.code-block-title {
  min-width: 0;
  overflow: hidden;
  color: #e6edf3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-block-lang {
  flex-shrink: 0;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(56, 193, 207, 0.14);
  color: #7fdde6;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.35rem 0.7rem;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #21262d;
  color: #c9d1d9;
  font-family: var(--sr-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.code-copy:hover {
  border-color: #8b949e;
  background: #30363d;
  color: #fff;
}

.code-copy.is-copied {
  border-color: rgba(63, 185, 80, 0.6);
  color: #7ee787;
}

.code-copy .icon-check,
.code-copy.is-copied .icon-copy {
  display: none;
}

.code-copy.is-copied .icon-check {
  display: inline;
}

.code-block .pygments-highlight {
  margin: 0;
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.25rem 1.1rem;
  overflow-x: auto;
  color: #e6edf3;
  background: transparent;
  font-family: var(--sr-font-mono);
  font-size: 0.875rem;
  font-variant-ligatures: none;
  line-height: 1.7;
  tab-size: 4;
  white-space: pre;
  scrollbar-color: #30363d transparent;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-footer {
  flex-shrink: 0;
  padding: 3.5rem 0 2rem;
  background: var(--sr-navy-deep);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9375rem;
}

.site-footer .footer-logo {
  display: block;
  height: 32px;
  width: auto;
  margin-bottom: 1rem;
}

.site-footer .footer-tagline {
  max-width: 22rem;
  margin: 0;
  line-height: 1.6;
}

.site-footer h2 {
  margin: 0 0 0.9rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--sr-cyan);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------------ */
/* Error pages                                                         */
/* ------------------------------------------------------------------ */

.error-page {
  padding: 5rem 0 6rem;
  text-align: center;
}

.error-page .error-code {
  margin: 0;
  color: var(--sr-cyan);
  font-size: clamp(4.5rem, 3rem + 6vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.error-page h1 {
  margin: 1rem 0 0.75rem;
  font-size: 2rem;
}

.error-page p {
  max-width: 32rem;
  margin: 0 auto 2rem;
  color: var(--sr-muted);
  font-size: 1.125rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
