/*
 * ExchangeRecover visual system adapted directly from Stardrive 1.4.2.
 * Core Stardrive traits retained:
 * - Geist-style typography
 * - #f26430 primary and #50168a secondary colors
 * - flat bordered cards with orange hover states
 * - italic/soft page headings
 * - galaxy hero treatment
 * - stone light/dark surfaces
 */

:root {
  color-scheme: light;
  --background: #fafaf9;
  --background-soft: #f5f5f4;
  --surface: #ffffff;
  --surface-muted: #f5f5f4;
  --text: #1c1917;
  --text-soft: #57534e;
  --text-faint: #78716c;
  --border: #d6d3d1;
  --border-strong: #a8a29e;
  --primary: #f26430;
  --primary-light: #f79461;
  --primary-dark: #c24b1f;
  --primary-darker: #6b2810;
  --secondary: #50168a;
  --secondary-light: #7b3fb2;
  --secondary-dark: #3e0f63;
  --secondary-soft: #f0e8f8;
  --header-bg: rgba(250, 250, 249, 0.92);
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.08);
  --shadow-strong: 0 18px 45px rgba(28, 25, 23, 0.15);
  --container: 1200px;
  --radius: 0.65rem;
}

html.dark {
  color-scheme: dark;
  --background: #1c1917;
  --background-soft: #292524;
  --surface: #1c1917;
  --surface-muted: #292524;
  --text: #fafaf9;
  --text-soft: #d6d3d1;
  --text-faint: #a8a29e;
  --border: #44403c;
  --border-strong: #57534e;
  --secondary-soft: #2d1b42;
  --header-bg: rgba(28, 25, 23, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 18px 45px rgba(0, 0, 0, 0.38);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

/* Header — based on Stardrive's 64px fixed header and plain navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.header-row {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  position: relative;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary-light), var(--primary), #b91c1c);
  color: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 10%, transparent);
}

.brand-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary);
}

.theme-toggle,
.mobile-menu-toggle,
.mobile-menu-close {
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover,
.mobile-menu-toggle:hover,
.mobile-menu-close:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #000;
  transform: translateY(-1px);
}

.theme-toggle svg,
.mobile-menu-toggle svg,
.mobile-menu-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-toggle .sun {
  display: none;
}

html.dark .theme-toggle .sun {
  display: block;
}

html.dark .theme-toggle .moon {
  display: none;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-menu-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: linear-gradient(135deg, #f5f5f4, #e7e5e4);
  color: #1c1917;
}

html.dark .mobile-menu-panel {
  background: linear-gradient(135deg, #0c0a09, #292524);
  color: #fafaf9;
}

.mobile-menu-panel.is-open {
  display: block;
}

.mobile-menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.mobile-menu-links {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100% - 3rem, 22rem);
  margin-inline: auto;
}

.mobile-menu-links a {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-menu-links a:last-child {
  border-bottom: 1px solid var(--border);
}

/* Stardrive galaxy hero */
.stardrive-hero {
  position: relative;
  isolation: isolate;
  min-height: 38rem;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #16003e 0%, #040010 55%, #000 100%);
  color: #fff;
}

.stardrive-hero::before,
.stardrive-hero::after {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
}

.stardrive-hero::before {
  background:
    radial-gradient(ellipse 50% 36% at 22% 34%, rgba(80, 22, 138, 0.7), transparent 66%),
    radial-gradient(ellipse 35% 28% at 78% 62%, rgba(242, 100, 48, 0.26), transparent 66%),
    radial-gradient(ellipse 48% 44% at 62% 18%, rgba(80, 22, 138, 0.38), transparent 62%);
  animation: nebula-pulse 20s ease-in-out infinite alternate;
}

.stardrive-hero::after {
  opacity: 0.82;
  background-image:
    radial-gradient(circle at 12% 22%, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle at 25% 70%, #fff 0 1px, transparent 1.3px),
    radial-gradient(circle at 39% 15%, #fff 0 1.2px, transparent 1.5px),
    radial-gradient(circle at 52% 84%, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle at 63% 30%, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle at 74% 75%, #fff 0 1.2px, transparent 1.5px),
    radial-gradient(circle at 88% 18%, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle at 94% 58%, #fff 0 1px, transparent 1.3px);
  background-size: 18rem 18rem;
  animation: stars-drift 80s linear infinite;
}

@keyframes nebula-pulse {
  from { opacity: 0.72; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes stars-drift {
  to { transform: rotate(8deg) scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: 38rem;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(18rem, 0.88fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
  padding-block: clamp(4.5rem, 9vw, 7rem);
}

.hero-copy {
  max-width: 46rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.hero-chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0.28rem rgba(242, 100, 48, 0.18);
}

.hero-title {
  margin: 1rem 0 1.25rem;
  max-width: 11ch;
  color: #fff;
  font-size: clamp(2.7rem, 6.4vw, 5.1rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 760;
  text-wrap: balance;
  text-shadow: 0 0 80px rgba(242, 100, 48, 0.22);
}

.hero-title .accent {
  color: var(--primary-light);
}

.hero-subline {
  max-width: 39rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(1rem, 1.65vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.btn-primary,
.btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.65rem;
  padding: 0.68rem 1rem;
  border-radius: 0.3rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #000;
  box-shadow: 0 0.7rem 1.8rem rgba(242, 100, 48, 0.2);
}

.btn-primary:hover {
  background: var(--primary-light);
  color: #000;
  transform: translateY(-1px);
}

.btn-subtle {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  backdrop-filter: blur(12px);
}

.btn-subtle:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #000;
}

.hero-product {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 27rem;
}

.hero-product::before {
  content: "";
  position: absolute;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 22, 138, 0.5), rgba(242, 100, 48, 0.12) 42%, transparent 70%);
  filter: blur(16px);
}

.hero-product-card {
  position: relative;
  width: min(100%, 28rem);
  min-height: 25rem;
  display: grid;
  place-items: center;
  padding: 2.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 60px rgba(80, 22, 138, 0.22),
    inset 0 0 40px rgba(80, 22, 138, 0.08);
  backdrop-filter: blur(14px);
}

.hero-product-card img {
  width: 100%;
  max-height: 20rem;
  object-fit: contain;
  filter: drop-shadow(0 1.4rem 1.8rem rgba(0, 0, 0, 0.4));
}

.hero-orbit {
  position: absolute;
  inset: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transform: rotate(-18deg);
}

/* Generic Stardrive content sections */
.section {
  padding-block: clamp(3.6rem, 7vw, 6rem);
}

.section-muted {
  position: relative;
  border-block: 1px solid var(--border);
  background: var(--background-soft);
}

.graph-paper {
  position: relative;
  isolation: isolate;
}

.graph-paper::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 1.25rem 1.25rem;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 74%);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.dark .section-kicker {
  color: var(--primary-light);
}

.section-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 720;
  text-wrap: balance;
}

.section-copy {
  max-width: 43rem;
  margin: 0.55rem 0 0;
  color: var(--text-soft);
}

.section-link {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.section-link:hover {
  color: var(--primary);
}

/* Product cards — same flat, bordered, rounded Stardrive card language */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.product-card,
.article-card,
.guide-card {
  min-width: 0;
}

.product-card > a,
.article-card > a,
.guide-card > a {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  filter: drop-shadow(0 0.4rem 0.75rem rgba(28, 25, 23, 0.08));
  transition: border-color 180ms ease, filter 180ms ease, transform 180ms ease;
}

html.dark .product-card > a,
html.dark .article-card > a,
html.dark .guide-card > a {
  filter: drop-shadow(0 0.4rem 0.75rem rgba(0, 0, 0, 0.22));
}

.product-card > a:hover,
.article-card > a:hover,
.guide-card > a:hover {
  border-color: var(--primary);
  color: var(--text);
  filter: drop-shadow(0 0.85rem 1.25rem rgba(28, 25, 23, 0.16));
  transform: translateY(-2px);
}

.product-image {
  position: relative;
  height: 13.5rem;
  display: grid;
  place-items: center;
  padding: 1.3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 78% 15%, color-mix(in srgb, var(--secondary) 13%, transparent), transparent 46%),
    linear-gradient(150deg, var(--surface-muted), var(--surface));
}

.product-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--primary) 8%, transparent), transparent 48%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.product-card > a:hover .product-image::after {
  opacity: 1;
}

.product-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 180ms ease;
}

.product-card > a:hover .product-image img {
  transform: scale(1.025);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem 1.1rem;
  background: linear-gradient(to right, var(--surface), var(--surface));
  transition: background 180ms ease;
}

.product-card > a:hover .card-body,
.article-card > a:hover .card-body,
.guide-card > a:hover .card-body {
  background: linear-gradient(to right, color-mix(in srgb, var(--primary-light) 18%, var(--surface)), color-mix(in srgb, var(--primary-light) 7%, var(--surface)));
}

.card-body h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.card-body p {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.card-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.77rem;
}

.card-arrow {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 180ms ease;
}

.product-card > a:hover .card-arrow,
.article-card > a:hover .card-arrow,
.guide-card > a:hover .card-arrow {
  transform: translateX(0.22rem);
}

/* Article lists */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.article-grid-featured {
  display: grid;
  gap: 1rem;
}

.article-feature {
  margin-bottom: 2.2rem;
  padding-bottom: 2.2rem;
  border-bottom: 2px solid var(--border);
}

.article-feature .article-card > a {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 1.1fr);
}

.article-card .media,
.guide-card .media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.article-feature .article-card .media {
  aspect-ratio: auto;
  min-height: 21rem;
  border-right: 1px solid var(--border);
  border-bottom: 0;
}

.article-card .media img,
.guide-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.article-card > a:hover .media img,
.guide-card > a:hover .media img {
  transform: scale(1.025);
}

.article-card .card-body,
.guide-card .card-body {
  min-height: 12rem;
}

.article-feature .card-body {
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.article-feature .card-body h3 {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  color: var(--text-faint);
  font-size: 0.76rem;
  font-weight: 650;
}

.pill,
.year-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
}

.pill {
  margin-bottom: 0.65rem;
  border-color: color-mix(in srgb, var(--secondary) 42%, var(--border));
  background: var(--secondary-soft);
  color: var(--secondary);
}

html.dark .pill {
  color: #d8b4fe;
}

.year-chip:hover,
.year-chip[aria-current="page"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #000;
}

.year-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* Interior page title, directly inspired by Stardrive blog H1 */
.page-hero {
  padding-block: clamp(2.6rem, 6vw, 4.7rem) 2.2rem;
}

.page-hero .container {
  position: relative;
}

.page-eyebrow {
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.dark .page-eyebrow {
  color: var(--primary-light);
}

.page-title {
  margin: 0.7rem 0 0.8rem;
  max-width: 19ch;
  color: var(--text);
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
  font-style: italic;
  font-weight: 760;
  text-wrap: balance;
}

.page-description {
  max-width: 48rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* Article pages — mirrors Stardrive's title image, italic H1, bordered body, and sticky TOC */
.article-page {
  padding-block: 2.2rem 5rem;
}

.article-header {
  display: flex;
  flex-direction: column;
}

.title-image {
  width: 100%;
  max-height: 25rem;
  margin-bottom: 1.5rem;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  box-shadow: var(--shadow);
}

.article-title {
  max-width: 52rem;
  margin: 0;
  padding-inline: 0.45rem;
  font-size: clamp(2.25rem, 5.2vw, 4.2rem);
  line-height: 1.07;
  letter-spacing: -0.04em;
  font-style: italic;
  font-weight: 760;
  text-wrap: balance;
}

.article-meta {
  order: -1;
  align-self: flex-end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
  margin: 0 0 0.8rem;
  padding-inline: 0.45rem;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.article-meta svg {
  width: 0.85rem;
  height: 0.85rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 15rem);
  align-items: start;
  gap: 1.2rem;
  margin-top: 3rem;
}

.prose {
  min-width: 0;
  padding: clamp(1.1rem, 3.2vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  line-height: 1.78;
}

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

.prose > :last-child {
  margin-bottom: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -0.025em;
  scroll-margin-top: 5.5rem;
}

.prose h2 {
  margin: 4rem 0 1.4rem;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

.prose h3 {
  margin: 2.8rem 0 1.1rem;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.prose h4 {
  margin: 2rem 0 0.85rem;
  font-size: 1.2rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15rem 1.35rem;
  padding: 0;
}

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

.prose a {
  color: var(--primary-dark);
  font-weight: 650;
}

html.dark .prose a {
  color: var(--primary-light);
}

.prose img {
  display: block;
  max-width: 100%;
  max-height: 42rem;
  margin: 1.6rem auto;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  object-fit: contain;
}

.prose video {
  display: block;
  width: 100%;
  margin-block: 1.6rem;
  border-radius: var(--radius);
  background: #000;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--border-strong);
  color: var(--text-soft);
  font-size: 1.12rem;
  font-style: italic;
}

.prose table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.prose code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--border) 45%, transparent);
  font-size: 0.9em;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius);
  background: #0c0a09;
  color: #fafaf9;
}

.notice {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.toc-card,
.resource-card {
  position: sticky;
  top: 5.2rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
}

.toc-links {
  display: grid;
  padding: 0.75rem 0;
}

.toc-links a {
  padding: 0.42rem 1rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.toc-links a.depth-3 {
  padding-left: 1.75rem;
  font-size: 0.76rem;
}

.toc-links a:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.resource-card img {
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.resource-card-body {
  padding: 1rem;
}

.resource-card-body h2 {
  margin: 0;
  font-size: 1rem;
}

.resource-card-body p {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

/* Footer CTA + footer — mirrors Stardrive's purple/orange promotion and dark footer */
.footer-cta {
  position: relative;
  overflow: hidden;
  padding-block: 3.5rem;
  background:
    radial-gradient(circle at 80% 20%, rgba(242, 100, 48, 0.35), transparent 28rem),
    linear-gradient(135deg, var(--secondary-dark), #19002f);
  color: #fff;
}

.footer-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  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: 1.3rem 1.3rem;
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 68%);
}

.footer-cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer-cta h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
}

.footer-cta p {
  max-width: 40rem;
  margin: 0.65rem 0 0;
  color: rgba(255,255,255,0.68);
}

.site-footer {
  padding-block: 3.6rem 1.5rem;
  background: #1c1917;
  color: #fafaf9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr;
  gap: 2.8rem;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 0.7rem;
  color: #fafaf9;
}

.site-footer h2 {
  font-size: 1.45rem;
}

.site-footer h3 {
  font-size: 1rem;
}

.site-footer p,
.site-footer a {
  color: #a8a29e;
}

.site-footer p {
  max-width: 33rem;
  margin: 0;
}

.footer-links {
  display: grid;
  gap: 0.45rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.copyright {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid #44403c;
  color: #78716c;
  font-size: 0.78rem;
}

.empty {
  padding: 2.4rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  text-align: center;
}

@media (max-width: 976px) {
  .product-grid,
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-feature .article-card > a {
    grid-template-columns: minmax(14rem, 0.75fr) minmax(0, 1.25fr);
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc-card,
  .resource-card {
    position: static;
  }

  .toc-card {
    order: -1;
  }
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-grid;
  }

  .header-actions {
    gap: 0.65rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    text-align: center;
    margin-inline: auto;
  }

  .hero-title,
  .hero-subline {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-product {
    min-height: 22rem;
  }

  .hero-product-card {
    min-height: 20rem;
  }

  .footer-cta-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 1.2rem), var(--container));
  }

  .brand span:last-child {
    display: none;
  }

  .product-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-feature .article-card > a {
    display: flex;
  }

  .article-feature .article-card .media {
    min-height: 14rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-meta {
    align-self: flex-start;
    justify-content: flex-start;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid > :first-child {
    grid-column: auto;
  }
}
