/* ═══════════════════════════════════════════════
   Margin Marketing Website — Layout & Components
   Extends brand.css with patterns from website-spec.md
   ═══════════════════════════════════════════════ */

/* ── Easing Tokens ── */

:root {
  --ease-out-expo:   cubic-bezier(.16, 1, .3, 1);
  --ease-out-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out-smooth: cubic-bezier(.04, .7, .14, 1);
}

/* ── Z-Index Scale ── */

:root {
  --z-base:    0;
  --z-raised:  1;
  --z-sticky:  100;
  --z-toast:   200;
  --z-overlay: 9999;
}

/* ── Shadow Scale ── */

:root {
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-md:   0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg:   0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl:   0 8px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.06);
}

[data-theme="dark"] {
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-md:   0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg:   0 2px 4px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl:   0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Button Anchors ── */
/* Ensure <a> elements with .btn render correctly as inline-flex and inherit no underline */

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ── Containers ── */

.container        { max-width: 1100px; margin: 0 auto; padding: 0 3rem; }
.container-narrow { max-width: 780px;  margin: 0 auto; padding: 0 3rem; }
.container-wide   { max-width: 1320px; margin: 0 auto; padding: 0 3rem; }

@media (max-width: 768px) { .container, .container-narrow, .container-wide { padding: 0 2rem; } }
@media (max-width: 640px) { .container, .container-narrow, .container-wide { padding: 0 1.5rem; } }
@media (max-width: 380px) { .container, .container-narrow, .container-wide { padding: 0 1rem; } }

/* ── Content Widths ── */

:root {
  --measure-body: 65ch;
  --measure-narrow: 45ch;
}

/* ── Responsive Grids ── */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-lg); }

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── Section Anatomy ── */

.section {
  padding: 4rem 0;
  scroll-margin-top: 3.5rem;
}

.section + .section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4xl);
}

/* First section after hero — divider line to separate from hero/screenshot */
.hero + main .section:first-child {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4xl);
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: var(--weight-medium);
  color: var(--color-heading);
  line-height: var(--leading-h1);
  letter-spacing: var(--tracking-h1);
  margin-bottom: 2rem;
}

.section-desc {
  color: var(--color-muted);
  max-width: 55ch;
  margin-bottom: 2.5rem;
  font-size: var(--text-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.section-desc-center {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .section + .section { padding-top: 3rem; }
}

@media (max-width: 640px) {
  .section { padding: 2rem 0; }
  .section + .section { padding-top: 2rem; }
  .section-desc { margin-bottom: 1.5rem; }
}

/* ── Full-Bleed Sections ── */

.section-full {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0;
}

/* ── Sticky Navigation ── */

.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--surface-page) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  opacity: 0;
  /* Exit: fade out, then snap transform after invisible */
  transition: opacity 0.4s var(--ease-out-smooth), transform 0s 0.4s;
}

.sticky-nav.visible {
  transform: translateY(0);
  opacity: 1;
  /* Enter: slide down + fade in together */
  transition: transform 0.5s var(--ease-out-smooth), opacity 0.3s var(--ease-out-smooth);
}

/* Homepage nav starts hidden (inline style="display:none"), JS shows after scroll past hero. */

.sticky-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  transition: color 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

/* ── Nav dropdowns (Features, Industries) ── */

.nav-link-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-link-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.nav-chevron {
  transition: transform 0.18s ease;
  opacity: 0.7;
}

.nav-link-wrap:hover .nav-chevron,
.nav-link-wrap:focus-within .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 240px;
  background: rgba(26, 21, 37, 0.94);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 1000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), inset 0 0.5px 0 0 rgba(139, 92, 246, 0.12);
  pointer-events: none;
}

.nav-link-wrap:hover .nav-dropdown,
.nav-link-wrap:focus-within .nav-dropdown {
  pointer-events: auto;
}

[data-theme="light"] .nav-dropdown {
  background: rgba(245, 243, 247, 0.94);
  box-shadow: 0 12px 28px rgba(26, 21, 37, 0.10), inset 0 0.5px 0 0 rgba(139, 92, 246, 0.12);
}

/* Invisible bridge so the cursor can travel from trigger to panel without losing hover */
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-link-wrap:hover .nav-dropdown,
.nav-link-wrap:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: var(--weight-medium);
  color: var(--color-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-dropdown-link:hover {
  background: rgba(139, 92, 246, 0.14);
  color: var(--color-heading);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.nav-dropdown-link-all {
  color: var(--violet-400);
  font-weight: var(--weight-semibold);
}

[data-theme="light"] .nav-dropdown-link-all {
  color: var(--violet-600);
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-right .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: var(--space-xs) var(--space-sm);
  margin: calc(-1 * var(--space-xs)) calc(-1 * var(--space-sm));
}

.nav-logo {
  height: 26px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .sticky-nav-inner { padding: 0 2rem; }
  .nav-links { display: none; }
  .nav-login-link { display: none; }

  /* Homepage: nav always visible on mobile so hamburger is accessible */
  .sticky-nav.homepage-nav {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Nav Hamburger ── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-heading);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-out-expo), opacity 0.3s;
}

.nav-hamburger.active .nav-hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-hamburger.active .nav-hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active .nav-hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
}

/* ── Mobile Overlay Menu ── */

.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sticky) - 1);
  background: color-mix(in srgb, var(--surface-page) 96%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out-expo), visibility 0.3s;
  display: none;
}

.nav-mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .nav-mobile-overlay { display: block; }
  .nav-mobile-overlay.open { display: block; }
}

.nav-mobile-inner {
  padding: 6rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-height: 100vh;
  overflow-y: auto;
}

.nav-mobile-group-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.nav-mobile-link {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--weight-medium);
  color: var(--color-heading);
  text-decoration: none;
  padding: var(--space-xs) 0;
  transition: color 0.2s;
}

.nav-mobile-link:hover {
  color: var(--color-accent);
}

.nav-mobile-link-parent {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-sm);
}

.nav-mobile-sublink {
  display: block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: var(--weight-regular);
  color: var(--color-muted);
  text-decoration: none;
  padding: 0.4rem 0 0.4rem 1rem;
  transition: color 0.2s;
}

.nav-mobile-sublink:hover {
  color: var(--color-accent);
}

.nav-mobile-actions {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Theme Toggle (icon) ── */

.theme-toggle-icon {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-faint);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-full);
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-icon:hover {
  color: var(--color-muted);
}

/* Show sun in dark mode, moon in light mode */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

@media (max-width: 768px) {
  .theme-toggle-icon { display: none; }
}

/* ── Hero ── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink-900);
  color: var(--ink-50);
}

[data-theme="light"] .hero {
  background: var(--violet-50);
}

/* Hero nav — logo + links at top of hero */

.hero-nav {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 3rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

.hero-nav-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hero-nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.hero-nav-links a {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-400);
  transition: color 0.2s;
  white-space: nowrap;
}

.hero-nav-links a:hover {
  color: var(--violet-400);
}

[data-theme="light"] .hero-nav-links a {
  color: var(--ink-500);
}

[data-theme="light"] .hero-nav-links a:hover {
  color: var(--violet-600);
}

/* Hero body — centered content with room for planet below */

.hero-body {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 3rem 8rem;
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--weight-regular);
  line-height: var(--leading-hero);
  letter-spacing: var(--tracking-hero);
  color: var(--ink-50);
  max-width: 900px;
}

[data-theme="light"] .hero-title {
  color: var(--ink-900);
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--ink-400);
  max-width: 50ch;
  margin: 1.5rem auto 2rem;
  line-height: var(--leading-body);
}

/* Hero screenshot — sits above the planet, reveals on scroll */
.hero-screenshot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(80%);
  width: 100%;
  max-width: 1100px;
  padding: 0 3rem;
  box-sizing: border-box;
  z-index: 2;
}

@media (max-width: 768px) {
  .hero-screenshot { width: calc(100% - 4rem); }
}

@media (max-width: 640px) {
  .hero-screenshot { width: calc(100% - 3rem); }
}

[data-theme="light"] .hero-tagline {
  color: var(--ink-500);
}

.hero-cta-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Planet — massive sphere on the horizon, matching brand site */

.planet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(92%);
  width: 220vmin;
  height: 220vmin;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: planet-rise 1.4s cubic-bezier(.16, 1, .3, 1) 0.8s forwards;
}

@keyframes planet-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(96%); }
  to   { opacity: 1; transform: translateX(-50%) translateY(92%); }
}

.planet-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 30%,
    #A375FC 0%,
    #8B5CF6 18%,
    #7340E0 36%,
    #5C2DBF 52%,
    #46219A 68%,
    #2D1B69 82%,
    rgba(45, 27, 105, 0.4) 93%,
    transparent 100%
  );
  box-shadow: 0 0 120px 40px rgba(139, 92, 246, 0.2);
  transition: background 0.3s;
}

[data-theme="light"] .planet-core {
  background: radial-gradient(
    circle at 50% 30%,
    #D4BBFF 0%,
    #BC94FF 18%,
    #A375FC 36%,
    #8B5CF6 52%,
    #7340E0 68%,
    #5C2DBF 82%,
    rgba(92, 45, 191, 0.3) 93%,
    transparent 100%
  );
  box-shadow:
    0 0 160px 60px rgba(139, 92, 246, 0.35),
    0 0 60px 20px rgba(139, 92, 246, 0.2);
}

.planet-atmosphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 40%,
    transparent 55%,
    rgba(139, 92, 246, 0.15) 72%,
    rgba(139, 92, 246, 0.06) 88%,
    transparent 100%
  );
  will-change: opacity;
  pointer-events: none;
}

/* Canvas — positioned at top of planet sphere for the margin line arc */

.planet canvas {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 60%;
  pointer-events: none;
  z-index: 2;
}

/* Stars — radial-gradient approach matching brand site for higher density */

.stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.stars::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 65%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 10%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 85% 30%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 50% 90%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 35% 35%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 65% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 20% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 45% 55%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 5% 40%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 95% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 30% 95%, rgba(255,255,255,0.35), transparent);
}

[data-theme="light"] .stars { display: none; }

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

@media (max-width: 640px) {
  .hero-nav { padding: 1.5rem 1.5rem 0; }
  .hero-body { padding: 2rem 1.5rem; }
  .hero-title { font-size: clamp(2rem, 10vw, 3.5rem); }
  .hero-tagline { font-size: var(--text-caption); }
}

/* ── Scroll Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger {
  transition-delay: calc(var(--stagger, 0) * 100ms);
}

/* ── Stat Block ── */

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-display);
  font-weight: var(--weight-regular);
  color: var(--color-heading);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-bottom: var(--space-sm);
}

.stat-desc {
  font-size: var(--text-small);
  color: var(--color-muted);
  line-height: var(--leading-small);
  max-width: 24ch;
}

.stat-source {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--color-muted);
  margin-top: var(--space-xs);
  text-decoration: none;
  transition: color 0.2s;
}

a.stat-source:hover {
  color: var(--color-accent);
}

/* ── Comparison Row ── */

.comparison-wrapper {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  overflow: hidden;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table td {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table th {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0 0 var(--space-md) 0;
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
}

.comparison-table td:first-child {
  color: var(--color-muted);
  padding-right: var(--space-xl);
  width: 50%;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--color-muted) 40%, transparent);
}

.comparison-table td:last-child {
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
}

/* Checkmark on the Margin column */
.comparison-table td:last-child::before {
  content: '✓';
  color: var(--color-accent);
  font-weight: var(--weight-bold);
  line-height: var(--leading-body);
}

@media (max-width: 640px) {
  .comparison-table,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table td {
    display: block;
    width: 100%;
  }

  .comparison-table tr {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
  }

  .comparison-table tr:last-child {
    border-bottom: none;
  }

  .comparison-table td {
    padding: 0;
    border-bottom: none;
  }

  .comparison-table td:first-child {
    width: 100%;
    padding-right: 0;
    font-size: var(--text-small);
    margin-bottom: var(--space-xs);
  }

  .comparison-table td:last-child {
    font-size: var(--text-body);
  }
}

/* ── CTA Section (full-bleed) ── */

.cta-section {
  position: relative;
  background: var(--ink-900);
  color: var(--ink-50);
  padding: var(--space-4xl) 0;
  text-align: center;
  overflow: hidden;
}

/* Violet radial glow behind CTA content */
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 92, 246, 0.12) 0%,
    rgba(139, 92, 246, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.cta-section > .container {
  position: relative;
  z-index: 1;
}

.cta-section.violet {
  background: var(--violet-500);
}

.cta-section.violet::before {
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    transparent 70%
  );
}

.cta-section .section-title {
  color: var(--ink-50);
}

.cta-section .section-desc {
  color: var(--ink-400);
  margin-left: auto;
  margin-right: auto;
}

.cta-section.violet .section-desc {
  color: rgba(245, 243, 247, 0.8);
}

/* CTA screenshot preview */
.cta-has-screenshot {
  padding-bottom: 0;
}

.cta-screenshot {
  position: relative;
  z-index: 0;
  max-width: 900px;
  margin: -2rem auto 0;
  padding: 0 3rem;
  pointer-events: none;
}

.cta-screenshot .screenshot {
  transform: translateY(55%);
}

@media (max-width: 768px) {
  .cta-screenshot { padding: 0 2rem; }
}

@media (max-width: 640px) {
  .cta-screenshot { padding: 0 1.5rem; }
}

/* ── FAQ ── */

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  cursor: pointer;
  padding: var(--space-lg) 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary .chevron {
  transition: transform 0.2s var(--ease-out-expo);
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.faq-item[open] summary .chevron {
  transform: rotate(180deg);
}

.faq-item.closing summary .chevron {
  transform: rotate(0deg);
}

.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out-expo);
}

.faq-item[open] .faq-answer-wrap {
  grid-template-rows: 1fr;
}

.faq-item.closing .faq-answer-wrap {
  grid-template-rows: 0fr;
}

.faq-answer {
  overflow: hidden;
}

.faq-answer-inner {
  padding-bottom: var(--space-lg);
  color: var(--color-muted);
  line-height: var(--leading-body);
  max-width: var(--measure-body);
}

/* ── Pricing Table (matches app's PlanSelection) ── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  align-items: start;
}

/* Uniform card — same style for all tiers, matching app */
.pricing-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

/* Popular card — same bg, accent border + badge */
.pricing-card.popular {
  border-color: var(--color-accent);
}

.pricing-popular-badge-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pricing-popular-badge {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  background: var(--surface-raised);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 0.25rem 0.75rem 0.15rem;
  border-radius: 9999px;
  white-space: nowrap;
  line-height: 1;
}

.pricing-card-inner {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.pricing-plan-name {
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-body); /* was --color-muted; failed AA (4.04:1) on dark cards */
  margin-bottom: var(--space-sm);
}

.pricing-price-block {
  margin-bottom: var(--space-2xs);
}

.pricing-amount {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: var(--weight-bold);
  color: var(--color-heading);
  line-height: 1;
}

.pricing-period {
  font-size: var(--text-small);
  font-weight: var(--weight-regular);
  color: var(--color-muted);
}

.pricing-billing-note {
  /* color-mix(70% muted, 30% faint) blended too light to pass AA on
     ink-100 surface (4.1:1). Use --color-muted directly. */
  font-size: var(--text-caption);
  color: var(--color-muted);
  margin-bottom: var(--space-md);
}

.pricing-cta {
  display: block;
  text-decoration: none;
  text-align: center;
  width: 100%;
  white-space: nowrap;
}

.pricing-divider {
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.pricing-features li {
  font-size: var(--text-small);
  color: var(--color-body);
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--space-xs);
  line-height: 1.4;
}

.pricing-features li.disabled {
  /* The line-through carries the "disabled" semantic — text color can
     stay at full body contrast (passes AA in both themes). Color-only
     "disabled" cues are a WCAG no-no anyway. */
  color: var(--color-body);
  text-decoration: line-through;
  text-decoration-color: var(--color-faint);
  text-decoration-thickness: 1px;
}

.pricing-check,
.pricing-dash {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.pricing-check {
  color: var(--color-accent);
}

.pricing-dash {
  color: var(--color-faint);
}

/* Toggle — matches app's segmented control */
.pricing-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 3px;
  gap: 0;
  margin-bottom: var(--space-2xl);
}

.pricing-toggle button {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  padding: 0.4rem 1.25rem;
  border: none;
  border-radius: 9999px;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-toggle button.active {
  background: var(--violet-600);
  color: var(--ink-50);
}

.pricing-toggle .save-badge {
  font-size: var(--text-micro);
  font-weight: var(--weight-semibold);
  background: rgba(52, 211, 153, 0.15);
  color: var(--jade-400);
  border: 1px solid var(--jade-400);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.pricing-toggle button.active .save-badge {
  /* Drop the white overlay entirely — adding white to violet-600 only
     made the bg blend lighter (3.65 → 2.87 with brighter overlay). Sit
     the badge directly on the violet-600 button bg with white text
     (5.1:1 — passes AA) and a slightly brighter border for definition. */
  background: transparent;
  color: var(--ink-50);
  border-color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
}

/* ── Screenshot Treatment ── */

.screenshot {
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  height: auto;
}

.screenshot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 50%, transparent);
  pointer-events: none;
  z-index: var(--z-raised);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-on-dark {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.15), var(--shadow-glow);
}

.screenshot-on-dark::after {
  box-shadow: inset 0 0 0 1px var(--fixed-dark-border);
}

[data-theme="light"] .screenshot-on-dark {
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .screenshot-on-dark::after {
  box-shadow: inset 0 0 0 1px var(--border);
}

/* ── Lists ── */

.list-dash {
  list-style: none;
  padding-left: 0;
}

.list-dash li {
  position: relative;
  padding-left: 1.25em;
  margin-bottom: var(--space-xs);
}

.list-dash li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.list-numbered {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
}

.list-numbered li {
  counter-increment: item;
  position: relative;
  padding-left: 2em;
  margin-bottom: var(--space-xs);
}

.list-numbered li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-accent);
  letter-spacing: var(--tracking-label);
}

/* ── Link Styles ── */
/* Applies to prose/content areas. The global reset (a{color:inherit;text-decoration:none})
   strips default link styling; these selectors restore it where links should be visible. */

.content a,
.faq-answer a,
.section-desc a,
.card-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}

.content a:hover,
.faq-answer a:hover,
.section-desc a:hover,
.card-body a:hover {
  color: var(--color-accent-hover, var(--violet-400));
}

/* ── Footer ── */

.footer {
  background: var(--surface-raised);
  border-top: 1px solid var(--border-strong);
  padding: var(--space-4xl) 0 var(--space-2xl);
  position: relative;
}

/* Subtle top edge glow for visual separation */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--color-accent) 15%, transparent) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.breadcrumb-band {
  padding-top: var(--space-lg);
}

/* ── Legal document typography (Terms, Privacy) ── */
.legal-content {
  font-size: var(--text-body);
  color: var(--color-body);
  line-height: var(--leading-body);
}

.legal-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-display);
  color: var(--color-heading);
  margin-bottom: var(--space-md);
}

/* Date header ("Last updated / Effective date") — uses the same .t-caption
   pattern the rest of the site uses for date stamps: sans, soft, muted.
   Markdown puts both lines in one paragraph, so flex-column splits them. */
.legal-content > p:first-of-type {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  line-height: var(--leading-compact);
  letter-spacing: var(--tracking-caption);
  color: var(--color-muted);
  margin-bottom: var(--space-2xl);
}
.legal-content > p:first-of-type strong {
  font-weight: var(--weight-semibold);
}

.legal-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.legal-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
}

/* Numbered h3 (e.g. "3.1 Information You Provide") gets the same gutter
   treatment as numbered paragraphs, for visual consistency. */
.legal-content h3.legal-numbered {
  padding-left: 4rem;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  max-width: var(--measure-body);
  margin-bottom: var(--space-md);
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.4rem;
}

.legal-content li {
  margin-bottom: 0.4em;
}

.legal-content li::marker {
  color: var(--color-faint);
}

.legal-content strong {
  color: inherit;
  font-weight: var(--weight-semibold);
}

.legal-content a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--color-faint);
}
.legal-content a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* Hanging-indent for three patterns inside a legal doc:
   1) Numbered subsection ("2.1 License.", "17.12 ...") — number in gutter
   2) Sub-list item ("(a) ...", "(i) ...") — letter/roman in deeper gutter
   3) Continuation paragraph — plain <p> that follows a numbered subsection;
      indented to align with the parent's body.
   Classes applied by a small inline script in Base.astro. */
.legal-content .legal-numbered,
.legal-content .legal-sublist {
  position: relative;
}
.legal-content .legal-numbered-tag,
.legal-content .legal-sublist-tag {
  position: absolute;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  color: var(--color-faint);
  line-height: inherit;
  padding-top: 0.22em;
  text-align: right;
}

/* Numbered subsection: tag sits in 0–3.5rem gutter (right-aligned so
   "2.1" and "17.12" both end at the same line), body starts at 4rem. */
.legal-content .legal-numbered {
  padding-left: 4rem;
}
.legal-content .legal-numbered-tag {
  left: 0;
  width: 3rem;
  padding-right: 0.5rem;
}

/* Sub-list: tag sits aligned with parent's body indent (4rem), body
   indents further so the sublist reads as subordinate. Tighter spacing
   between items since they're related. */
.legal-content .legal-sublist {
  padding-left: 7rem;
  margin-bottom: 0.5em;
}
.legal-content .legal-sublist-tag {
  left: 4rem;
  width: 2.5rem;
  padding-right: 0.5rem;
}

/* Continuation paragraph: a plain <p> that belongs to the current numbered
   subsection (script tags it during a second pass). Indents to align with
   the parent's body. */
.legal-content .legal-continuation {
  padding-left: 4rem;
}

/* Restore normal paragraph spacing after the last item in a sublist run. */
.legal-content .legal-sublist + :not(.legal-sublist) {
  margin-top: var(--space-md);
}

.legal-content blockquote {
  border-left: 3px solid var(--color-accent);
  background: var(--surface-card);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: 0 8px 8px 0;
  color: var(--color-heading);
  font-size: 0.92em;
}
.legal-content blockquote p {
  color: inherit;
  margin-bottom: 0;
  max-width: none;
}

/* Pete's markdown uses `---` between sections; the h2 border-bottom already
   carries the section-break weight, so hide the redundant rules. */
.legal-content hr {
  display: none;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: var(--text-meta);
}
.legal-content th,
.legal-content td {
  border: 1px solid var(--border);
  padding: var(--space-sm);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}
.legal-content th {
  background: var(--surface-card);
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
}
.legal-content td {
  color: var(--color-muted);
}

.legal-content code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-card);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Click-to-zoom screenshot lightbox ── */
.screenshot img {
  cursor: pointer;
}

.screenshot-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 11, 25, 0.92);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  opacity: 0;
  transition: opacity 0.22s ease;
  cursor: zoom-out;
}

.screenshot-zoom-overlay.open { opacity: 1; }

.screenshot-zoom-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}

.screenshot-zoom-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 1;
}

.screenshot-zoom-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.screenshot-zoom-close:focus-visible {
  outline: 2px solid var(--color-accent, #7340E0);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .screenshot-zoom-overlay,
  .screenshot-zoom-close { transition: none; }
}

.footer-col-heading {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.footer-link {
  display: block;
  font-size: var(--text-small);
  color: var(--color-muted);
  text-decoration: none;
  padding: var(--space-2xs) 0;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--color-heading);
}

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: var(--text-body);
  color: var(--color-muted);
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
}

.footer-wordmark {
  height: 1.1em;
  width: auto;
  vertical-align: baseline;
  position: relative;
  top: 0.3em;
  color: var(--color-muted);
}

.footer-legal {
  font-size: var(--text-caption);
  color: var(--color-muted);
}

.footer-logo {
  height: 28px;
  width: auto;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; gap: var(--space-sm); text-align: center; }
}

/* ── Page Hero (interior pages) ── */

.page-hero {
  padding: 10rem 0 6rem;
  border-top: none;
}

.page-hero + .section {
  padding-top: var(--space-xl);
}

.page-hero .section-desc {
  max-width: 70ch;
  margin-bottom: var(--space-md);
}

.page-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-regular);
  color: var(--color-heading);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-bottom: 2rem;
}

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

@media (max-width: 640px) {
  .page-hero { padding: 5rem 0 2rem; }
}

/* ── Feature Detail Page ── */

.feature-body {
  max-width: var(--measure-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-body);
}

.feature-body p + p {
  margin-top: var(--space-md);
}

.value-shift {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-xl);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.value-shift-before {
  color: var(--color-muted);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--color-muted) 40%, transparent);
}

.value-shift-arrow {
  color: var(--color-accent);
  font-size: var(--text-h2);
  line-height: 1;
}

.value-shift-after {
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
}

@media (max-width: 640px) {
  .value-shift {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-md);
  }
}

/* ── Comparison Detail Table (vs/ pages) ── */

.comparison-detail-table { width: 100%; border-collapse: collapse; }
.comparison-detail-table th {
  font-family: var(--font-mono); font-size: var(--text-label);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--color-muted); text-align: left; padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-strong);
}
.comparison-detail-table td {
  padding: var(--space-md) 0; border-bottom: 1px solid var(--border);
  font-size: var(--text-small); line-height: var(--leading-small);
}
.comparison-detail-table td:first-child { color: var(--color-muted); width: 40%; }
.comparison-detail-table td:nth-child(2) { color: var(--color-body); }
.comparison-detail-table td:last-child { color: var(--color-heading); font-weight: var(--weight-medium); }

@media (max-width: 640px) {
  .comparison-detail-table { font-size: var(--text-caption); }
  .comparison-detail-table td:first-child { width: 30%; }
}

/* ── Verdict Card ── */

.verdict-card {
  background: var(--surface-raised);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-glow);
}

/* ── Index Grid Card (vs/ and for/ index pages) ── */

.index-grid-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.index-grid-card .card-body {
  flex: 1;
}

.index-grid-card .card-arrow {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-accent);
  margin-top: var(--space-sm);
  transition: transform 0.2s;
}

.index-grid-card:hover .card-arrow {
  transform: translateX(4px);
}

/* ── Prose Content Blocks ── */

.prose {
  max-width: var(--measure-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-body);
}

.prose p + p { margin-top: var(--space-md); }

.prose h3 {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
}

.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-lg);
  color: var(--color-heading);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  margin: var(--space-xl) 0;
}

/* ── Feature Blocks (alternating image + text rows) ── */

.feature-block {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--space-2xl);
  align-items: center;
}

.feature-block.reverse {
  direction: rtl;
}

.feature-block.reverse > * {
  direction: ltr;
}

.feature-block-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-block-content .section-title {
  margin-bottom: var(--space-md);
}

.feature-block-content .section-desc {
  margin-bottom: var(--space-sm);
}

.feature-block-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  text-decoration: none;
  margin-top: var(--space-md);
  transition: gap 0.2s var(--ease-out-expo);
}

.feature-block-link:hover {
  gap: var(--space-sm);
}

.feature-block-image {
  width: 100%;
}

@media (max-width: 768px) {
  .feature-block,
  .feature-block.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: var(--space-xl);
  }
}

/* ── Positioning Spectrum ── */

.spectrum-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.spectrum {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.spectrum-end {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.spectrum-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), var(--color-accent), var(--border-strong));
  margin: 0 var(--space-lg);
  position: relative;
}

.spectrum-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-page);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, var(--border));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spectrum-caption {
  font-size: var(--text-small);
  color: var(--color-muted);
  line-height: var(--leading-small);
  text-align: center;
  text-wrap: pretty;
}

@media (max-width: 640px) {
  .spectrum {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
  }
  .spectrum-line {
    width: 2px;
    height: 60px;
    flex: none;
    margin: 0;
    background: linear-gradient(180deg, var(--border-strong), var(--color-accent), var(--border-strong));
  }
}

/* ── Step Blocks (expanded how-it-works) ── */

.step-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.step-number {
  font-family: var(--font-mono);
  font-size: var(--text-display);
  font-weight: var(--weight-regular);
  color: var(--color-accent);
  line-height: 1;
  opacity: 0.3;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

@media (max-width: 640px) {
  .step-block {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ── Why Now Cards ── */

.why-now-card {
  padding: var(--space-xl);
  border-left: 3px solid var(--color-accent);
}

.why-now-card .card-title {
  margin-bottom: var(--space-sm);
}

/* ── Boundary List (What Margin is NOT) ── */

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-md);
}

.boundary-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-small);
  color: var(--color-muted);
}

.boundary-item .x-mark {
  color: var(--color-accent);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

/* ── Contact Page ── */

.contact-email-link {
  font-family: var(--font-mono);
  font-size: var(--text-h2);
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-email-link:hover {
  color: var(--color-accent-hover);
}

/* ── Noise Grain Overlay ── */
/* body needs position:relative so the ::before pseudo-element renders.
   z-index: 9999 matches brand site (above all content, pointer-events: none). */

body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Reduced Motion ── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
