:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --card: #f6f6f6;
  --accent: #2f6fde;
  --max: 1000px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #ececec;
    --muted: #9a9a9a;
    --line: #262626;
    --card: #1b1b1b;
    --accent: #6c9eff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 48px 20px 0; }

/* Banner */
.banner { position: relative; margin-bottom: 72px; }
.banner-img {
  display: block;
  width: 100%;
  aspect-ratio: 4.5 / 1;
  object-fit: cover;
  object-position: center 60%;
  border-radius: 14px;
}
.avatar {
  position: absolute;
  left: 24px;
  bottom: -56px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
}

/* Intro */
.intro { padding: 16px 0; }
.intro h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.intro p { color: var(--muted); margin: 0; font-size: 18px; max-width: 640px; }

/* Sections */
section { padding: 36px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; font-weight: 600; }
.section-head a { font-size: 15px; }

/* About */
.about p { margin: 0; max-width: 640px; }

/* Post list */
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.posts a { color: var(--text); }
.posts time { color: var(--muted); font-size: 15px; white-space: nowrap; }

/* Videos: large 16:9 thumbnails with the title and channel/date underneath,
   in a 3/2/1-column grid. */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.video-card { display: block; color: var(--text); }
.video-card:hover { text-decoration: none; }
.video-card img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 12px; background: var(--card); margin-bottom: 12px;
  transition: opacity 0.15s;
}
.video-card:hover img { opacity: 0.85; }
.video-card strong {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-weight: 600; line-height: 1.35;
}
.video-card:hover strong { color: var(--accent); }
.video-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }

/* Cards (apps, picks) */
/* Every card on the site is the same size: icon left, a one-line title and
   exactly two lines of text, in a 3/2/1-column grid. */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}
.card:hover { text-decoration: none; background: var(--card); }
div.card:hover { background: none; }
.card img.avatar-sm { border-radius: 50%; }
.card img.thumb { object-fit: cover; }
.badge {
  display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 1px 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
}
.card img, .card .icon {
  width: 48px; height: 48px; border-radius: 11px; flex-shrink: 0;
  background: var(--card);
  display: grid; place-items: center; font-size: 22px;
}
.card picture { flex-shrink: 0; line-height: 0; }
.card strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card > div { min-width: 0; }

/* Company logos sit in a white tile the size of the app icons */
.card img.logo {
  object-fit: contain; padding: 6px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--line);
}
.card small {
  color: var(--muted); font-size: 15px; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; min-height: 3em; /* always 2 lines tall */
}

/* Article */
article { padding: 16px 0 48px; }
article h1 { font-size: 32px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; }
article .meta { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
article.page-head { padding-bottom: 0; }
article.page-head .meta { margin-bottom: 8px; }

/* App page header (support + App Store badge) */
.app-hero { padding: 16px 0 36px; max-width: 680px; }
.app-title { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.app-icon { display: block; width: 72px; height: 72px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15)); }
.app-hero h1 { font-size: 40px; line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
.app-hero p { color: var(--muted); font-size: 18px; margin: 0 0 20px; }
.app-store-badge { display: inline-block; line-height: 0; }
.app-store-badge img { display: block; width: 150px; height: auto; }

.app-section { max-width: 680px; }
.app-section h2 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.app-section .meta { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.app-section details > p { margin: 0; }
.app-section summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-section summary::-webkit-details-marker { display: none; }
.app-section summary h2 { margin: 0; }
.app-section summary::after {
  content: ""; flex-shrink: 0; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.2s;
}
.app-section details[open] > summary::after { transform: translateY(3px) rotate(-135deg); }
.app-section details[open] > summary { margin-bottom: 12px; }
.callout { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.callout p { margin: 0; }

/* Support: search, topic chips and expandable articles */
.support .support-intro { color: var(--muted); margin: 0 0 18px; }
.support-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--text);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  -webkit-appearance: none; appearance: none;
}
.support-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.support-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.support-topics a {
  font-size: 14px; color: var(--text); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.support-topics a:hover { border-color: var(--muted); }
.support-group { scroll-margin-top: 16px; }
.support-group h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 6px; }
.support-group h3 span { font-size: 14px; font-weight: normal; color: var(--muted); margin-left: 6px; }
.app-section details.faq { border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.app-section details.faq > summary { padding: 14px 0; font-weight: 600; font-size: 17px; }
.app-section details.faq > summary::after { width: 7px; height: 7px; }
.app-section details.faq[open] > summary { margin-bottom: 0; }
.faq .answer { padding: 0 0 16px; }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child, .faq .answer ul:last-child { margin-bottom: 0; }
.faq .answer ul { padding-left: 20px; margin: 0 0 10px; }
.faq .answer li { margin-bottom: 4px; }
.support-empty { color: var(--muted); margin: 24px 0 0; }
.support-stuck { margin-top: 32px; }

/* App Store screenshots (filled in by tools/sync_appstore.py) */
.gallery { margin: 0 0 36px; }
.screenshots {
  list-style: none; margin: 0; padding: 0 0 12px;
  display: flex; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.screenshots li { flex: 0 0 auto; scroll-snap-align: start; }
.screenshots img {
  display: block; width: 220px; height: auto;
  border-radius: 20px; border: 1px solid var(--line); background: var(--card);
}
@media (max-width: 480px) { .screenshots img { width: 180px; border-radius: 16px; } }

/* Blog posts (built by tools/build_blog.py) */
.card .icon.number { font-size: 20px; font-weight: 700; color: var(--muted); }
article.post { max-width: 680px; }
.post-hero { display: block; width: 100%; height: auto; border-radius: 14px; margin: 0 0 24px; }
article.post h2 { font-size: 24px; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -0.01em; }
article.post h3 { font-size: 19px; line-height: 1.3; margin: 28px 0 8px; }
article.post ul, article.post ol { padding-left: 22px; }
article.post li { margin-bottom: 8px; }
.disclaimer { color: var(--muted); font-size: 15px; font-style: italic; }
.placeholder { background: #fff3b0; color: #5c4a00; padding: 0 4px; border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 20px 0; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table-wrap th { font-weight: 600; background: var(--card); }
h2.series { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 14px; font-weight: 600; }

/* Long-form text pages (privacy policies) */
.policy { max-width: 680px; }
.policy h3 { font-size: 20px; line-height: 1.3; margin: 36px 0 8px; }
.policy ul { padding-left: 20px; }
.policy li { margin-bottom: 8px; }

/* Footer */
footer.site { border-top: 1px solid var(--line); margin-top: 32px; padding: 28px 0 48px; color: var(--muted); font-size: 15px; }
footer.site a { color: var(--muted); margin-right: 16px; }

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .video-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .intro h1 { font-size: 28px; }
  .banner { margin-bottom: 44px; }
  .banner-img { aspect-ratio: 3 / 1; border-radius: 10px; }
  .avatar { width: 84px; height: 84px; left: 14px; bottom: -36px; }
}
