/* Header & navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: var(--border-hairline) solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: var(--space-md);
}

.header-inner .site-nav {
  flex: 1;
  justify-content: center;
}

.settings-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  color: var(--color-text-muted);
  background: transparent;
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-out);
}

.settings-trigger:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .settings-trigger:hover {
    color: var(--color-primary-text);
    background: var(--color-bg-elevated);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
}

.brand:hover {
  text-decoration: none;
}

/* Manual dark theme: logo.svg uses prefers-color-scheme; swap via JS */
.brand-logo {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  background: transparent;
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-out);
}

.nav-toggle:active {
  transform: scale(0.97);
}

.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin-inline: auto;
  background: var(--color-text);
  border-radius: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-primary-text);
}

@media (max-width: 960px) {
  .header-inner {
    justify-content: flex-start;
  }

  .header-inner .site-nav {
    flex: unset;
    justify-content: unset;
  }

  .nav-toggle {
    display: flex;
  }

  .settings-trigger {
    margin-left: auto;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-lg);
    background: var(--color-bg);
    border-bottom: var(--border-hairline) solid var(--color-border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    /* Exit: quicker; enter (below) uses the standard duration — asymmetric. */
    transition:
      transform var(--transition-fast) var(--ease-out),
      opacity var(--transition-fast) var(--ease-out);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    transition:
      transform var(--transition-base) var(--ease-out),
      opacity var(--transition-base) var(--ease-out);
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Preferences dialog */
.preferences-dialog {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  flex-direction: column;
  width: min(calc(100% - 2rem), 24rem);
  max-width: calc(100% - 2rem);
  max-height: min(
    90dvh,
    calc(
      100dvh - env(safe-area-inset-top, 0px) -
        env(safe-area-inset-bottom, 0px) - 2rem
    )
  );
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-elevated);
  color: var(--color-text);
}

.preferences-dialog[open],
.preferences-dialog.is-open {
  display: flex;
  opacity: 1;
  /* Modal: scale from center is correct — it isn't anchored to a trigger. */
  transform: scale(1);
  transition:
    opacity var(--transition-base) var(--ease-out),
    transform var(--transition-base) var(--ease-out);
}

/* Entry only: materialize from a near-full scale + fade, never from nothing.
   Exit stays instant (display:none is discrete) so dismissal feels snappy.
   Under reduced motion the global transition-duration override collapses this
   to an instant appearance. */
@starting-style {
  .preferences-dialog[open],
  .preferences-dialog.is-open {
    opacity: 0;
    transform: scale(0.96);
  }
}

.preferences-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.preferences-dialog[open]::backdrop {
  transition: opacity var(--transition-base) var(--ease-out);
}

@starting-style {
  .preferences-dialog[open]::backdrop {
    opacity: 0;
  }
}

.preferences-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
}

body.preferences-dialog-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

.preferences-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.preferences-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.preferences-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.preferences-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: transparent;
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-out);
}

.preferences-close:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .preferences-close:hover {
    background: var(--color-bg-elevated);
  }
}

.preferences-intro {
  margin: 0 0 var(--space-lg);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.preferences-fieldset {
  margin: 0 0 var(--space-md);
  padding: var(--space-md);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
}

.preferences-fieldset legend {
  padding: 0 var(--space-xs);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Preference tile radio groups */
.pref-tile-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.pref-tile-group--theme,
.pref-tile-group--appearance,
.pref-tile-group--override {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pref-text-scale-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.pref-text-scale-slider {
  width: 100%;
  min-height: max(2.75rem, 44px);
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.pref-text-scale-slider:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.pref-text-scale-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.pref-text-scale-input {
  width: 5rem;
  min-height: max(2.75rem, 44px);
  margin: 0;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  background: var(--color-bg-elevated);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-sm);
}

.pref-text-scale-input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.pref-text-scale-suffix {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.pref-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: max(2.75rem, 44px);
  min-width: max(2.75rem, 44px);
  padding: var(--space-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-base),
    background var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast) var(--ease-out);
}

.pref-tile:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .pref-tile:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border-strong);
  }
}

.pref-tile:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.pref-tile.is-selected,
.pref-tile[aria-checked="true"] {
  border-color: var(--color-primary);
  background: var(--color-brand-subtle);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

.pref-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--color-text);
}

.pref-tile-icon--text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pref-tile-icon--palette {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.1875rem;
  width: 100%;
  max-width: 3.5rem;
  height: 2rem;
}

.pref-palette-bar {
  flex: 1 1 0;
  min-width: 0.625rem;
  border-radius: var(--radius-sm);
  border: var(--border-hairline) solid var(--color-border);
}

.pref-palette-bar--default-1 { background: #a88200; }
.pref-palette-bar--default-2 { background: #4688c7; }
.pref-palette-bar--default-3 { background: #6f8f7a; }

.pref-palette-bar--cb-1 { background: #0000cc; }
.pref-palette-bar--cb-2 { background: #ffaa00; }
.pref-palette-bar--cb-3 { background: #0066cc; }

.pref-palette-bar--rg-1 { background: #0066cc; }
.pref-palette-bar--rg-2 { background: #ffcc00; }
.pref-palette-bar--rg-3 { background: #3399ff; }

/* Accessibility section */
.section-lead {
  margin: 0 0 var(--space-sm);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
}

.a11y-subheading {
  margin: 0 0 var(--space-sm);
  font-size: 1.125rem;
  font-weight: 600;
}

.a11y-modes-desc {
  margin: 0 0 var(--space-lg);
  max-width: 42rem;
  color: var(--color-text-muted);
}

.a11y-mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-md);
  margin: 0 0 var(--space-2xl);
  padding: 0;
  list-style: none;
}

.a11y-mode-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--demo-bg, var(--color-surface));
  border: var(--border-hairline) solid var(--demo-border, var(--color-border));
  border-radius: var(--radius-md);
  color: var(--demo-text, var(--color-text));
}

.a11y-mode-demo-swatches {
  display: flex;
  gap: var(--space-sm);
}

.a11y-demo-swatch {
  flex: 1;
  height: 0.75rem;
  border-radius: var(--radius-sm);
  border: var(--border-hairline) solid
    color-mix(in srgb, var(--demo-border, var(--color-border)) 70%, transparent);
}

.a11y-demo-primary { background: var(--demo-primary); }
.a11y-demo-secondary { background: var(--demo-secondary); }
.a11y-demo-success { background: var(--demo-success); }

.a11y-mode-demo-copy {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.a11y-mode-demo.demo-default {
  --demo-primary: #a88200;
  --demo-secondary: #4688c7;
  --demo-success: #4ecf88;
  --demo-bg: var(--color-surface);
  --demo-border: var(--color-border);
  --demo-text: var(--color-text);
}

.a11y-mode-demo.demo-color-vision-deficiency {
  --demo-primary: #0000cc;
  --demo-secondary: #ffaa00;
  --demo-success: #007799;
  --demo-bg: #fafbfd;
  --demo-border: #dde3ee;
  --demo-text: #0f1520;
}

.a11y-mode-demo.demo-red-green-deficiency {
  --demo-primary: #0066cc;
  --demo-secondary: #ffcc00;
  --demo-success: #0099cc;
  --demo-bg: #f7f3ee;
  --demo-border: #e0d5c8;
  --demo-text: #1a1410;
}

:root[data-theme="dark"] .a11y-mode-demo.demo-default {
  --demo-bg: var(--color-surface);
  --demo-border: var(--color-border);
  --demo-text: var(--color-text);
}

:root[data-theme="dark"] .a11y-mode-demo.demo-color-vision-deficiency {
  --demo-primary: #0000cc;
  --demo-secondary: #ffaa00;
  --demo-success: #007799;
  --demo-bg: #161b27;
  --demo-border: #1e2738;
  --demo-text: #e8edf5;
}

:root[data-theme="dark"] .a11y-mode-demo.demo-red-green-deficiency {
  --demo-primary: #0066cc;
  --demo-secondary: #ffcc00;
  --demo-success: #0099cc;
  --demo-bg: #1f1c19;
  --demo-border: #3d3833;
  --demo-text: #f2ede6;
}

.a11y-mode-name {
  display: block;
  margin-bottom: 0.125rem;
  font-size: 0.9375rem;
  color: var(--demo-text, var(--color-text));
}

.a11y-mode-text {
  display: block;
  font-size: 0.875rem;
  color: color-mix(
    in srgb,
    var(--demo-text, var(--color-text-muted)) 72%,
    var(--demo-text, var(--color-text)) 28%
  );
}

.a11y-feature-grid {
  margin-bottom: var(--space-xl);
}

.a11y-statement {
  margin: 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Name origin */
.name-origin {
  padding-block: var(--space-2xl);
}

.name-origin-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-lg);
  margin: 0 0 var(--space-lg);
}

.name-origin-pillar {
  margin: 0;
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.name-origin-term {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.name-origin-syllable {
  display: inline-block;
  min-width: 2rem;
  margin-right: var(--space-xs);
  font-weight: 700;
  color: var(--color-primary-text);
}

.name-origin-meaning::before {
  content: "→ ";
  font-weight: 400;
  color: var(--color-text-muted);
}

.name-origin-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.name-origin-summary {
  margin: 0 auto;
  max-width: 42rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* Hero */
.hero {
  padding-block: var(--space-3xl) var(--space-2xl);
  overflow-x: hidden;
  background: linear-gradient(
    180deg,
    var(--color-brand-subtle) 0%,
    var(--color-bg) 60%
  );
}

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

/* Landing mode (soft launch): no app-screenshot visual, so the hero is a
   single, wider text column. */
.hero-grid--text {
  grid-template-columns: 1fr;
}

.hero-grid--text .hero-content {
  max-width: 44rem;
}

/* "In development — coming soon" pill on the landing hero. */
.hero-badge {
  display: inline-block;
  margin: 0 0 var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-content {
  max-width: 36rem;
}

.hero-title {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 0 0 var(--space-xl);
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin: 0 0 var(--space-2xl);
  padding: 0;
  list-style: none;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.hero-trust-check {
  flex-shrink: 0;
  color: var(--color-success-text);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -18%;
  background: radial-gradient(
    circle at 50% 50%,
    var(--color-brand-subtle),
    transparent 65%
  );
  filter: blur(32px);
  z-index: 0;
}

.hero-visual img {
  position: relative;
  z-index: 1;
  width: 82%;
  transform: rotate(-12deg);
  border-radius: var(--radius-lg);
  box-shadow:
    0 32px 56px -20px rgba(26, 22, 18, 0.28),
    0 10px 20px -8px rgba(26, 22, 18, 0.16);
  mask-image: radial-gradient(
    ellipse 72% 72% at 50% 50%,
    black 62%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 72% 72% at 50% 50%,
    black 62%,
    transparent 100%
  );
}

@media (max-width: 768px) {
  .hero-visual img {
    width: 100%;
    transform: none;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .hero-visual::before {
    display: none;
  }
}

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

/* Cards & grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
}

.card {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-md);
  background: var(--color-brand-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-primary-text);
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  max-width: none;
  flex-shrink: 0;
}

.card-title {
  margin: 0 0 var(--space-sm);
  font-size: 1.125rem;
  font-weight: 600;
}

.card-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Compact feature & challenge lists */
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.feature-row:focus-within {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-elevated);
}

@media (hover: hover) and (pointer: fine) {
  .feature-row:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-elevated);
  }
}

.feature-row-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.feature-row-index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
}

.feature-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-brand-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-primary-text);
}

.feature-row-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  max-width: none;
  flex-shrink: 0;
}

.feature-row.accent-secondary .feature-row-icon {
  color: var(--color-secondary);
  background: color-mix(in srgb, var(--color-secondary) 8%, transparent);
}

.feature-row.accent-tertiary .feature-row-icon {
  color: var(--color-tertiary);
  background: color-mix(in srgb, var(--color-tertiary) 8%, transparent);
}

.feature-row-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.feature-row-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.feature-row-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.feature-row-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.feature-row-reveal {
  opacity: 0;
  transform: translateY(0.75rem);
  transition:
    opacity var(--transition-base) var(--ease-out),
    transform var(--transition-base) var(--ease-out);
}

.feature-row-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Never let scroll-reveal leave rendered content invisible when printing or
   capturing a full page (the observer only fires on real scroll). */
@media print {
  .feature-row-reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .feature-list {
    grid-template-columns: 1fr;
  }
}

/* Screenshot carousel */
.carousel {
  position: relative;
  outline: none;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  /* Slides stacked in one grid cell so switching is an opacity crossfade.
     The old `transition: transform` never fired — JS swapped via [hidden]
     (display:none), which cannot animate. */
  display: grid;
}

.carousel-slide {
  grid-area: 1 / 1;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-out);
}

.carousel-slide.is-active {
  opacity: 1;
}

.carousel-figure {
  position: relative;
  margin: 0;
}

.carousel-image-stack {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 1280 / 900;
  box-shadow: var(--shadow-elevated);
}

.carousel-image-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to right,
    transparent 0%,
    transparent 55%,
    color-mix(in srgb, var(--color-bg) 14%, transparent) 72%,
    color-mix(in srgb, var(--color-bg) 30%, transparent) 100%
  );
  pointer-events: none;
}

.carousel-image-smear {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 32% center;
  transform: scale(1.65);
  filter: blur(52px) saturate(1.1);
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 30%,
    black 58%,
    black 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    transparent 30%,
    black 58%,
    black 100%
  );
}

.carousel-image-main {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(
    to right,
    black 0%,
    black 50%,
    transparent 84%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    black 0%,
    black 50%,
    transparent 84%
  );
}

.carousel-caption-overlay {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%;
  display: flex;
  align-items: center;
  margin: 0;
  padding: var(--space-xl) var(--space-lg);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-primary-text);
  text-shadow:
    0 0 1px var(--color-bg),
    0 1px 3px color-mix(in srgb, var(--color-bg) 80%, transparent),
    0 0 22px var(--color-bg),
    0 0 44px var(--color-bg);
}

@media (max-width: 720px) {
  .carousel-slide {
    padding: 0;
  }

  .carousel-image-stack {
    border-radius: 0;
    box-shadow: none;
    aspect-ratio: auto;
  }

  .carousel-image-stack::after {
    display: none;
  }

  .carousel-image-smear {
    display: none;
  }

  .carousel-image-main {
    position: static;
    height: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .carousel-caption-overlay {
    position: static;
    display: block;
    width: auto;
    max-width: 100%;
    margin-top: var(--space-md);
    padding: 0;
    text-align: center;
  }
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
  transition: transform var(--transition-fast) var(--ease-out),
    background var(--transition-fast);
}

.carousel-btn:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .carousel-btn:hover {
    background: var(--color-bg-elevated);
  }
}

.carousel-dots {
  display: flex;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.carousel-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.carousel-dot::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

.carousel-dot[aria-current="true"]::before {
  background: var(--color-primary);
  transform: scale(1.2);
}

/* Screenshot form-factor toggle (Desktop / Mobile) */
.screenshot-form-toggle {
  display: inline-flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding: var(--space-xs);
  background: var(--color-bg-elevated);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-full);
}

.screenshot-form-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: var(--space-xs) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--transition-fast) var(--ease-out),
    color var(--transition-fast) var(--ease-out);
}

.screenshot-form-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.screenshot-form-btn.is-active,
.screenshot-form-btn[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-elevated);
}

.screenshot-form-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .screenshot-form-btn:not(.is-active):hover {
    color: var(--color-text);
  }
}

/* Mobile screenshots: portrait phone centered on the blurred backdrop.
   Scoped to wide viewports; the max-width:720px block above already handles
   real narrow-screen visitors with its own full-bleed layout. */
@media (min-width: 721px) {
  /* Fit the screenshots section within the viewport height. The image height
     is derived from the width via aspect-ratio (1280:900), so cap the figure
     WIDTH to (available height * ratio); the height then follows and never
     exceeds the space left after the header + controls. min(100%) keeps it
     within the container on narrower viewports. Capping the figure (not just
     the image stack) keeps the caption overlay aligned to the image edge. */
  .carousel {
    /* Reserve = section chrome (header text, controls, padding ~397px) +
       the section's scroll-margin-top (sticky header 4rem + space-md), i.e.
       where the "Einblicke" nav link lands the section, so the whole section
       clears the sticky header and fits the viewport when scrolled into view. */
    --carousel-reserve: 30rem;
  }

  .carousel-figure {
    max-width: min(
      100%,
      calc((100svh - var(--carousel-reserve)) * 1280 / 900)
    );
    margin-inline: auto;
  }

  #screenshots {
    padding-block: var(--space-2xl);
  }

  #screenshots .section-header {
    margin-bottom: var(--space-lg);
  }

  .carousel.is-mobile .carousel-image-main {
    object-fit: contain;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .carousel.is-mobile .carousel-image-smear {
    object-position: center;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .carousel.is-mobile .carousel-image-stack::after {
    display: none;
  }

  .carousel.is-mobile .carousel-caption-overlay {
    inset: auto 0 0 0;
    width: auto;
    justify-content: center;
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    background: linear-gradient(
      to top,
      var(--color-bg) 0%,
      color-mix(in srgb, var(--color-bg) 70%, transparent) 55%,
      transparent 100%
    );
  }
}

/* Zoom / enlarge button on each carousel slide */
.carousel-zoom {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(2.5rem, 44px);
  height: max(2.5rem, 44px);
  padding: 0;
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-elevated);
  transition: transform var(--transition-fast) var(--ease-out),
    background var(--transition-fast);
}

.carousel-zoom svg {
  width: 1.25rem;
  height: 1.25rem;
}

.carousel-zoom:active {
  transform: scale(0.95);
}

.carousel-zoom:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .carousel-zoom:hover {
    background: var(--color-surface);
  }
}

/* Lightbox: full-viewport dialog showing the screenshot at large size */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1001;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  border: none;
  background: transparent;
  overflow: hidden;
}

.lightbox[open],
.lightbox.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fallback scrim when native showModal/::backdrop is unavailable. */
.lightbox.is-open {
  background: rgba(15, 23, 42, 0.82);
}

.lightbox::backdrop {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
}

.lightbox[open]::backdrop {
  transition: opacity var(--transition-base) var(--ease-out);
}

@starting-style {
  .lightbox[open]::backdrop {
    opacity: 0;
  }
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}

.lightbox-close {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-elevated);
  transition: transform var(--transition-fast) var(--ease-out),
    background var(--transition-fast);
}

.lightbox-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

.lightbox-close:active {
  transform: scale(0.95);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover {
    background: var(--color-bg-elevated);
  }
}

body.lightbox-open {
  overflow: hidden;
}

/* Comparison table */
.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: var(--border-hairline) solid var(--color-border);
}

.comparison-table th {
  font-weight: 600;
  background: var(--color-bg-elevated);
}

.comparison-table td:first-child {
  font-weight: 500;
}

.comparison-table .highlight {
  color: var(--color-primary-text);
  font-weight: 600;
}

/* Trust & privacy markers (verified facts only — no certifications) */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-marker {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin: 0;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
}

.trust-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-brand-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-primary-text);
}

.trust-marker-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  max-width: none;
  flex-shrink: 0;
}

.trust-marker-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.trust-marker-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.trust-marker-text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

#pricing {
  scroll-margin-top: calc(var(--header-height) + var(--space-md));
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-lg);
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--space-xl);
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.pricing-card > .btn {
  margin-top: auto;
}

.pricing-card.featured {
  border-color: var(--color-primary);
  border-width: 2px;
}

.pricing-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-contrast);
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.pricing-name {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  font-weight: 600;
}

.pricing-price {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-primary-text);
}

.pricing-period {
  margin: 0 0 var(--space-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.pricing-desc {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
}

.pricing-block {
  margin-bottom: var(--space-lg);
}

.pricing-block-title {
  margin: 0 0 var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pricing-separator {
  margin: var(--space-lg) 0;
  border: 0;
  border-top: var(--border-hairline) solid var(--color-border);
}

.pricing-includes {
  margin: 0 0 var(--space-md);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.pricing-price-annual {
  margin: calc(var(--space-sm) * -1) 0 var(--space-md);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.pricing-price-annual-value {
  font-weight: 600;
  color: var(--color-text);
}

.pricing-price-annual-note {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
}

.pricing-features {
  margin: 0 0 var(--space-xl);
  padding: 0;
  list-style: none;
}

.pricing-features li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
  font-size: 0.9375rem;
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success-text);
  font-weight: 600;
}

.pricing-toggle {
  display: inline-flex;
  gap: var(--space-xs);
  padding: var(--space-xs);
  margin-bottom: var(--space-lg);
  background: var(--color-bg);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-full);
}

.pricing-toggle-option {
  border-radius: var(--radius-full);
}

.pricing-toggle-option[aria-checked="true"] {
  color: var(--color-primary-contrast);
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Platforms */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--space-md);
}

.platform-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: var(--border-hairline) solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-fast),
    transform var(--transition-fast) var(--ease-out);
}

.platform-item:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  a.platform-item:hover {
    border-color: var(--color-primary);
    text-decoration: none;
  }

  a.platform-item:hover .platform-icon {
    color: var(--color-primary-text);
  }
}

.platform-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--color-text-muted);
  transition: color 0.15s ease, filter 0.15s ease;
}

.platform-icon img,
.platform-icon svg {
  display: block;
  width: 2rem;
  height: 2rem;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
}

:root[data-theme="dark"] .platform-icon img {
  filter: brightness(1.35);
}

@media (hover: hover) and (pointer: fine) {
  a.platform-item:hover .platform-icon img {
    filter: brightness(0.85) sepia(1) saturate(4) hue-rotate(5deg);
  }

  :root[data-theme="dark"] a.platform-item:hover .platform-icon img {
    filter: brightness(1.1) sepia(1) saturate(4) hue-rotate(5deg);
  }
}

/* Footer */
.site-footer {
  padding-block: var(--space-2xl);
  background: var(--color-bg-elevated);
  border-top: var(--border-hairline) solid var(--color-border);
}

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

.footer-brand {
  min-width: 12rem;
}

.footer-settings {
  min-width: 14rem;
}

.footer-settings-title {
  margin: 0 0 var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 600;
}

.footer-settings-desc {
  margin: 0 0 var(--space-md);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.footer-settings-summary {
  display: grid;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
  padding: 0;
}

.pref-summary-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
  font-size: 0.8125rem;
}

.pref-summary-item dt {
  margin: 0;
  color: var(--color-text-muted);
  font-weight: 500;
}

.pref-summary-item dd {
  margin: 0;
  color: var(--color-text);
}

.footer-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(2.75rem, 44px);
  height: max(2.75rem, 44px);
  padding: 0;
}

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

.footer-tagline {
  margin: 0;
  font-weight: 500;
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

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

/* Legal pages */
.legal-page {
  padding-block: var(--space-2xl) var(--space-3xl);
  max-width: 48rem;
}

.legal-header {
  margin-bottom: var(--space-2xl);
}

.legal-header h1 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.legal-meta {
  margin: 0 0 var(--space-md);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.legal-intro {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.legal-section {
  margin-bottom: var(--space-xl);
}

.legal-section h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  color: var(--color-primary-text);
}

.legal-section p {
  margin: 0 0 var(--space-sm);
  line-height: 1.6;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: var(--border-hairline) solid var(--color-border);
}
