/* ============================================
   Bartlett Butter — Subpage Style
   Shared, cacheable stylesheet for the `default` layout used by all
   marketing / support / privacy pages. Extracted from an inline <style>
   block so it is downloaded once and reused across every subpage.
   ============================================ */

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

:root {
  --neutral-0: #FFFFFF;
  --neutral-10: #F9FAFB;
  --neutral-20: #E5E7EB;
  --neutral-30: #D1D5DB;
  --neutral-40: #AEB2BA;
  --neutral-50: #6B7280;
  --neutral-60: #4B5563;
  --neutral-70: #374151;
  --neutral-80: #1F2937;
  --neutral-90: #111827;
  --neutral-100: #030712;

  --color-bg: var(--neutral-0);
  --color-bg-subtle: var(--neutral-10);
  --color-text: var(--neutral-80);
  --color-text-muted: var(--neutral-50);
  --color-text-strong: var(--neutral-100);
  --color-border: var(--neutral-20);

  --font: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Navigation ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-logo span {
  font-size: 16px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-strong);
}

.nav-logo span strong {
  font-weight: 700;
}

.nav-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 200ms ease;
}

.nav-back:hover {
  color: var(--color-text-strong);
}

/* ─── App Header ─── */
.app-header {
  text-align: center;
  padding: 64px 24px 48px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  /* Non-square source art (e.g. ETFWise 792x781) is cropped to fit the
     square container rather than stretched/distorted. */
  object-fit: cover;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.app-header p {
  font-size: 16px;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* App-level secondary nav — lets visitors who land from search or the
   App Store move laterally between an app's marketing, support, and
   privacy pages without bouncing to the homepage. */
.app-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.app-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.app-nav a:hover {
  color: var(--color-text-strong);
  border-color: var(--neutral-30);
}

.app-nav a[aria-current="page"] {
  background: var(--neutral-90);
  border-color: var(--neutral-90);
  color: var(--neutral-0);
}

/* Primary install CTA — surfaced in the header so high-intent visitors
   see it before the long-form copy, not buried mid-page. */
.app-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 28px;
  border-radius: 100px;
  background: var(--neutral-90);
  color: var(--neutral-0);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.app-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.app-cta svg {
  width: 16px;
  height: 16px;
}

/* In-page table of contents for long-form support/privacy pages, built
   by JS from the h2 headings so visitors can jump instead of scrolling. */
.page-toc {
  margin-bottom: 40px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-subtle);
}

.page-toc-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.page-toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0;
  margin: 0;
}

.page-toc li {
  margin: 0;
}

.page-toc a {
  font-size: 15px;
  font-weight: 500;
  color: var(--neutral-60);
  text-decoration: none;
  transition: color 200ms ease;
}

.page-toc a:hover {
  color: var(--color-text-strong);
}

/* Offset jump targets so headings clear the sticky nav bar. */
.content-body h2[id] {
  scroll-margin-top: 88px;
}

/* ─── Content ─── */
.content-body {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 40px 72px;
}

.content-body h1:first-child {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-strong);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.content-body h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-strong);
  letter-spacing: -0.01em;
  margin-top: 48px;
  margin-bottom: 12px;
}

.content-body h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-strong);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.content-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-strong);
  margin-top: 32px;
  margin-bottom: 8px;
}

.content-body p {
  margin-bottom: 16px;
  color: var(--color-text);
}

.content-body a {
  color: var(--neutral-60);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 200ms ease;
}

.content-body a:hover {
  color: var(--color-text-strong);
}

.content-body ul, .content-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content-body li {
  margin-bottom: 8px;
  color: var(--color-text);
}

.content-body strong {
  font-weight: 600;
  color: var(--color-text-strong);
}

.content-body blockquote {
  border-left: 3px solid var(--neutral-30);
  margin: 24px 0;
  padding: 12px 20px;
  color: var(--color-text-muted);
  font-style: italic;
  background: var(--color-bg-subtle);
  border-radius: 0 8px 8px 0;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
  line-height: 1.6;
}

.content-body th, .content-body td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.content-body th {
  font-weight: 600;
  color: var(--color-text-strong);
  background: var(--color-bg-subtle);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.content-body td:first-child {
  font-weight: 500;
  color: var(--color-text-strong);
  white-space: nowrap;
}

.content-body img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* App Store badge styling */
.content-body a[href*="apps.apple.com"] {
  display: block;
  text-align: center;
  margin: 32px 0;
  text-decoration: none;
}

.content-body a[href*="apps.apple.com"] img {
  display: inline-block;
  height: 48px;
  width: auto;
  transition: opacity 200ms ease, transform 200ms ease;
}

.content-body a[href*="apps.apple.com"] img:hover {
  opacity: 0.8;
  transform: scale(1.03);
}

/* Mobile table overflow */
.table-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

/* Scroll hint shown by JS only when a table actually overflows its
   container, so users know there is more content off-screen. */
.table-hint {
  display: none;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: -8px 0 20px;
  letter-spacing: 0.02em;
}

.table-hint.is-visible {
  display: block;
}

.table-wrapper table {
  margin: 0;
  min-width: 540px;
}

.table-wrapper th, .table-wrapper td {
  border-bottom: 1px solid var(--color-border);
}

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

/* ─── Footer ─── */
.footer {
  background: var(--neutral-100);
  color: var(--neutral-0);
  padding: 40px 40px 32px;
}

.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.footer-brand span {
  font-size: 14px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.footer-brand span strong {
  font-weight: 700;
}

.footer-copy {
  font-size: 13px;
  opacity: 0.4;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav {
    padding: 16px 20px;
  }

  /* Compact the sticky subpage header so the logo, wordmark, and back link
     don't crowd or shrink tap targets on smaller screens. */
  .nav-logo span {
    font-size: 14px;
  }

  .app-header {
    padding: 48px 20px 36px;
  }

  .app-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .content-body {
    padding: 36px 20px 48px;
  }

  .footer {
    padding: 32px 20px 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* On the narrowest screens, drop the wordmark to the logo mark alone so the
   sticky header stays uncrowded and the back link keeps a comfortable target. */
@media (max-width: 480px) {
  .nav-logo span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-back {
    font-size: 13px;
  }
}

/* ─── Accessibility ─── */
a:focus-visible {
  outline: 2px solid var(--neutral-90);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link — matches the homepage pattern so keyboard users get the same
   "jump to content" affordance across every surface. Visible only on focus. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--neutral-90);
  color: var(--neutral-0);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: top 200ms ease;
}

.skip-link:focus {
  top: 16px;
  color: var(--neutral-0);
}

/* The main landmark receives focus from the skip link but is a container,
   not a control — suppress the lingering outline. */
.content-body:focus {
  outline: none;
}

/* Clear the sticky nav when the skip link jumps to the content landmark. */
.content-body {
  scroll-margin-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
