/* Navigation */
.nav-wrapper {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-height);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.nav-wrapper > nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--ink);
  text-decoration: none;
}

.nav-logo img {
  width: 32px;
  height: 32px;
  filter: var(--logo-filter);
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-menu a,
.nav-lang {
  font-size: var(--text-label);
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--dur) var(--ease);
}

.nav-menu a:hover,
.nav-lang:hover {
  opacity: 1;
}

.nav-lang[aria-current="true"] {
  opacity: 1;
  font-weight: var(--weight-semibold);
}

.theme-toggle,
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 50%;
  opacity: 0.8;
  transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.theme-toggle:hover,
.mobile-menu-toggle:hover {
  opacity: 1;
  background-color: var(--hover-wash);
}

.js .theme-toggle {
  display: flex;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: var(--show-sun);
}

.theme-toggle .icon-moon {
  display: var(--show-moon);
}

.mobile-menu-toggle span {
  position: absolute;
  left: 8px;
  width: 16px;
  height: 1px;
  background-color: currentcolor;
  transition: transform var(--dur) var(--ease);
}

.mobile-menu-toggle {
  position: relative;
}

.mobile-menu-toggle span:first-child {
  top: 12px;
}

.mobile-menu-toggle span:last-child {
  bottom: 12px;
}

.mobile-menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

@media (max-width: 734px) {
  .js .mobile-menu-toggle {
    display: flex;
  }

  .nav-right {
    gap: var(--space-xs);
  }

  .js .nav-menu {
    position: absolute;
    top: 100%;
    inset-inline: var(--gutter);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--menu-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 0.5px solid var(--nav-hairline);
    border-radius: var(--radius-md);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur) var(--ease);
  }

  .js .nav-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s; /* focusable the moment it opens */
  }

  .js .nav-menu a {
    font-size: var(--text-body);
    letter-spacing: var(--tracking-body);
  }
}

/* Floating nav pill: shared by the home page and the subpages. */
.nav-wrapper--float {
  position: fixed;
  inset: 12px var(--gutter) auto;
  z-index: 100;
  height: auto;
  transform: translate3d(0, var(--nav-shift, 32px), 0);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

.nav-wrapper--float > nav {
  position: relative;
  max-width: none;
  width: 100%;
  height: 52px;
  padding: 0 8px 0 14px;
  gap: var(--space-md);
  pointer-events: auto;
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-edge);
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 30px rgb(0 0 20 / 0.28);
}

.nav-wrapper--float .nav-right {
  gap: var(--space-sm);
}

@media (min-width: 735px) {
  .nav-wrapper--float {
    right: auto;
    left: max(var(--gutter), 4vw);
  }

  .nav-wrapper--float > nav {
    width: auto;
    gap: var(--space-md);
  }

  .nav-wrapper--float .nav-menu {
    gap: var(--space-md);
    padding-left: var(--space-md);
    border-left: 1px solid var(--pill-edge);
  }

  .nav-wrapper--float .nav-menu a {
    font-size: 0.9375rem;
  }
}

@media (max-width: 734px) {
  .js .nav-wrapper--float .nav-menu {
    inset-inline: 0;
    top: calc(100% + 8px);
    margin: 0;
    border-radius: var(--radius-lg);
  }
}

/* Buttons: one action colour */
.btn {
  display: inline-block;
  padding: 0.75rem 1.875rem;
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.18;
  text-align: center;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast) var(--ease);
}

.btn--primary {
  color: var(--on-accent);
  background-color: var(--accent);
}

.btn--primary:hover,
.btn--primary:active {
  background-color: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
  letter-spacing: var(--tracking-headline);
  color: var(--link);
  text-decoration: none;
}

.link-cta::after {
  content: "\203A";
  font-size: 1.15em;
}

.link-cta:hover {
  text-decoration: underline;
}

/* Mac App Store badge: Apple's official SVG as an <img>, never redrawn. Min height 40px; the padding is the
   required clear space (a quarter of the badge height). Black on light grounds, white on dark. */
.app-store-badge {
  display: inline-block;
  padding: 10px;
  line-height: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.app-store-badge img {
  height: 40px;
  width: auto;
  min-height: 40px;
}

.app-store-badge .badge-light {
  display: var(--show-light-img);
}

.app-store-badge .badge-dark {
  display: var(--show-dark-img);
}

.app-store-badge:hover {
  opacity: 0.85;
}

/* The hero stage is dark in both themes, so it carries the white badge only. */
.app-store-badge--hero {
  margin-left: -10px;
}

.app-store-badge--hero img {
  height: 48px;
}

.badge-note {
  margin-top: var(--space-sm);
  font-size: var(--text-label);
  letter-spacing: 0;
  color: var(--muted);
}

/* Figure: transparent app window with drop-shadow and the "Sample data" caption. */
.app-figure {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.app-figure img {
  width: 100%;
  height: auto;
  filter: var(--window-shadow);
}

.app-figure--popover img {
  filter: var(--popover-shadow);
}

.app-figure .img-light {
  display: var(--show-light-img);
}

.app-figure .img-dark {
  display: var(--show-dark-img);
}

.app-figure figcaption {
  font-size: var(--text-caption);
  letter-spacing: 0;
  color: var(--muted);
  text-align: center;
}

/* Nav: wordmark and a compact Download action. */
.nav-wordmark {
  font-size: 1.0625rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-headline);
}

.nav-cta {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: var(--weight-regular);
  white-space: nowrap;
}

/* FAQ: native <details>, quiet rows with hairline dividers */
.faq-list {
  border-top: 1px solid var(--hairline);
}

.faq-list details {
  border-bottom: 1px solid var(--hairline);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
  font-size: var(--text-title);
  line-height: 1.3;
  letter-spacing: var(--tracking-headline);
  font-weight: var(--weight-semibold);
  list-style: none;
  cursor: pointer;
}

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

.faq-list summary::after {
  flex: none;
  content: "+";
  font-size: 1.75rem;
  font-weight: var(--weight-regular);
  line-height: 1;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}

.faq-list summary:hover::after {
  color: var(--ink);
}

.faq-list details[open] summary::after {
  content: "\2212";
}

.faq-list details > :not(summary) {
  max-width: var(--measure);
  color: var(--muted);
}

.faq-list details > :not(summary):last-child {
  padding-bottom: var(--space-md);
}

.faq-list details > p + p {
  margin-top: var(--space-xs);
}

.faq-list details > :not(summary) a {
  color: var(--link);
}

/* Footer */
footer {
  padding: var(--space-lg) 0 var(--space-xl);
  font-size: var(--text-label);
  line-height: 1.33;
  letter-spacing: 0;
  color: var(--muted);
  background-color: var(--footer-bg);
}

.footer-content {
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
