/*
 * Styles for the mytasks.fyi website (site/). Colours follow the app's design
 * tokens (src/tokens.css), in light and dark, chosen by the system setting.
 * No inline styles: the website's CSP allows only this file (src/lib/csp.ts).
 */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #24262b); /* the app's list pane (src/tokens.css --bg) */
  --bg-2: light-dark(#f2f2f4, #212227); /* the app's sidebar (--sidebar-bg) */
  --line: light-dark(#e3e3e7, #38383b);
  --text: light-dark(#1c1c1e, #ececf0);
  --text-2: light-dark(#55555a, #b6b6bc);
  --accent: #2f6fdb;
  --accent-text: light-dark(#1f5bb8, #7fb0ff);
  --warn-bg: light-dark(#fff7e6, #3a2f17);
  --warn-line: light-dark(#f0c36a, #8a6a25);
  --warn-text: light-dark(#6b4a00, #f3d28c);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; font-size: 17px; }
a { color: var(--accent-text); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
header.site { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; }
nav.main { display: flex; gap: 22px; margin-left: auto; align-items: center; }
nav.main a { color: var(--text-2); text-decoration: none; font-size: 15px; }
nav.main a:hover { color: var(--text); }
.btn { display: inline-block; background: var(--accent); color: #fff !important; text-decoration: none; font-weight: 600; padding: 10px 18px; border-radius: 10px; font-size: 15px; }
.btn.big { font-size: 18px; padding: 14px 26px; border-radius: 12px; }
.btn.ghost { background: transparent; color: var(--accent-text) !important; border: 1px solid var(--line); }

/* Hero */
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: 54px; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero p.lede { font-size: 21px; color: var(--text-2); max-width: 680px; margin: 0 auto 28px; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .small { font-size: 14px; color: var(--text-2); margin-top: 14px; }
.hero .donate { margin: 6px 0 0; }
.hero .donate .btn { display: inline-flex; align-items: center; gap: 8px; }
.shots { position: relative; max-width: 1000px; margin: 48px auto 0; }
.shots picture { display: block; }
.shots img { height: auto; }
.shots img.desk { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0,0,0,.18); }
.shots img.phone { position: absolute; right: -18px; bottom: -36px; width: 190px; border-radius: 28px; border: 6px solid #1c1c1e; box-shadow: 0 20px 40px rgba(0,0,0,.25); }

/* Limitations callout */
.callout { margin: 96px auto 0; max-width: 860px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 16px; padding: 26px 30px; }
.callout h2 { margin: 0 0 6px; font-size: 24px; color: var(--warn-text); }
.callout p { margin: 0 0 12px; }
.callout ul { margin: 0 0 14px; padding-left: 20px; }
.callout li { margin: 4px 0; }

/* Sections */
section.block { padding: 80px 0 0; }
section.block h2 { font-size: 36px; letter-spacing: -0.01em; text-align: center; margin: 0 0 12px; }
section.block p.sub { text-align: center; color: var(--text-2); font-size: 19px; max-width: 680px; margin: 0 auto 40px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
/* A lone card on the last row sits in the middle column. */
.grid3 > :last-child:nth-child(3n+1) { grid-column: 2; }
/* Home: common questions, each opening on click (<details>, no script). */
.faq { max-width: 760px; margin: 28px auto 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 4px; font-weight: 600; font-size: 18px; list-style-position: inside; }
.faq details p { margin: 0 4px 18px; color: var(--text-2); font-size: 16px; }
.card { background: var(--bg-2); border-radius: 16px; padding: 24px; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--text-2); font-size: 16px; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.steps .card::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 15px; }
table.cmp th, table.cmp td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; }
.closing { text-align: center; padding: 90px 0 70px; }
.closing h2 { font-size: 36px; margin: 0 0 18px; }

/* Long-form pages */
.page { max-width: 760px; margin: 0 auto; padding: 56px 24px 40px; }
.page h1 { font-size: 42px; margin: 0 0 8px; letter-spacing: -0.01em; }
.page .updated { color: var(--text-2); font-size: 15px; margin: 0 0 28px; }
.page h2 { font-size: 22px; margin: 36px 0 6px; }
.page .item { border-top: 1px solid var(--line); padding: 18px 0 4px; }
.page .item h3 { margin: 0 0 6px; font-size: 18px; }
.page .item p { margin: 0 0 8px; }
.page .item .do { color: var(--text-2); font-size: 16px; }
.toc { background: var(--bg-2); border-radius: 12px; padding: 16px 22px; font-size: 15px; }
.toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; }
.page .toc li { break-inside: avoid; margin: 0 0 4px; }

/* Footer: three titled columns, then a line with the policy pages and the licence. */
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 40px; font-size: 14px; color: var(--text-2); }
footer.site .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
footer.site h2 { font-size: 14px; color: var(--text); margin: 0 0 10px; }
footer.site .cols a { display: block; margin: 0 0 8px; }
footer.site a { color: var(--text-2); }
footer.site .base { display: flex; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; font-size: 13px; }
footer.site .base span { margin-left: auto; }

/* Wide tables scroll sideways on small screens. */
.table-scroll { overflow-x: auto; }

/* Keyboard keys in the guide */
kbd { font-family: inherit; font-size: 14px; background: var(--bg-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.page table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 16px; }
.page th, .page td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* Privacy's "What is stored, and where": room for the Where column, so it isn't squeezed to a word a line; scrolls sideways on phones. */
.page table.stored { min-width: 640px; }
.page table.stored th:first-child { width: 24%; min-width: 10em; }
.page table.stored th:nth-child(2) { width: 44%; }
/* The Compare page: wider, for its five columns; cells centred as on the old Home table. */
.page.wide { max-width: 1040px; }
.page table.cmp { min-width: 760px; table-layout: fixed; }
/* The four apps' columns share the width equally; the feature names take the rest. */
.page table.cmp th:first-child { width: 20%; }
.page table.cmp th, .page table.cmp td { text-align: center; vertical-align: middle; }
.page table.cmp th:first-child, .page table.cmp td:first-child { text-align: left; }
.page ol, .page ul { padding-left: 22px; }
.page li { margin: 4px 0; }
.page code { font-size: 15px; background: var(--bg-2); border-radius: 4px; padding: 1px 4px; }
/* Short CSV examples on the Import page; long lines scroll sideways. */
.page pre { background: var(--bg-2); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.page pre code { background: none; padding: 0; font-size: inherit; }

/* Small screens: the header keeps the logo and Open the app; the grids stack. */
@media (max-width: 760px) {
  body { font-size: 16px; }
  nav.main a:not(.btn) { display: none; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 38px; }
  .hero p.lede { font-size: 18px; }
  .shots img.phone { width: 120px; right: -6px; bottom: -24px; border-width: 4px; border-radius: 20px; }
  .grid3, .steps { grid-template-columns: 1fr; }
  .grid3 > :last-child:nth-child(3n+1) { grid-column: auto; }
  section.block h2, .closing h2 { font-size: 28px; }
  .page h1 { font-size: 32px; }
  .toc ol { columns: 1; }
  footer.site .cols { grid-template-columns: 1fr; gap: 18px; }
  footer.site .base span { margin-left: 0; }
}

/* Roadmap: one block per milestone, its version as a small pill after the title;
   completed milestones are muted. */
.milestone { border-top: 1px solid var(--line); padding: 16px 0 2px; }
.milestone h3 { margin: 0 0 4px; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.milestone .ver { font-size: 12px; font-weight: 600; color: var(--accent-text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.milestone ul { margin: 4px 0 12px; }
.milestone.done, .milestone.done .ver { color: var(--text-2); }
/* A finished item in a milestone still under way: a ✓ for its bullet, muted, with the version it arrived in. */
.milestone li.done { color: var(--text-2); list-style-type: '✓  '; }
.milestone li .ver { margin-left: 4px; font-size: 11px; vertical-align: 1px; }

/* The Book page: cover beside the description and downloads. */
.book { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; margin: 8px 0 12px; }
.book .cover { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 16px 34px rgba(0,0,0,.22); }
.book p { margin: 0 0 14px; }
.book .downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.book .small { font-size: 14px; color: var(--text-2); }
.book.home { grid-template-columns: 180px 1fr; max-width: 760px; margin: 28px auto 0; align-items: center; }
.book.home h3 { margin: 0 0 10px; font-size: 22px; }
@media (max-width: 640px) {
  .book, .book.home { grid-template-columns: 1fr; }
  .book .cover { max-width: 220px; margin: 0 auto; }
}
