/* Comic Archiver website. One layout for every page: a header band with the page's title and
   opening sentence, then its content. Light and dark follow the visitor's system setting. */

:root {
  color-scheme: light;
  --bg: #ffffff; --band: #f5f6f8; --panel: #ffffff; --border: #e2e5ea;
  --text: #15181d; --lede: #3d4450; --muted: #5d6673;
  --accent: #3346d3; --accent-hover: #2536b8; --on-accent: #ffffff; --accent-soft: #eef0fd;
  --ok: #157347; --ok-soft: #e7f5ee; --progress: #8a5300; --progress-soft: #fdf2e1;
  --idea: #5d6673; --idea-soft: #eef0f3; --notice: #fff6e5; --notice-text: #6b4100;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1014; --band: #151820; --panel: #171b22; --border: #272d37;
    --text: #e9ecf1; --lede: #c4cad3; --muted: #9ba4b1;
    --accent: #8d9bff; --accent-hover: #aab5ff; --on-accent: #0e1014; --accent-soft: #1d2240;
    --ok: #6fd39f; --ok-soft: #12281d; --progress: #f1b562; --progress-soft: #2c2213;
    --idea: #9ba4b1; --idea-soft: #1f242c; --notice: #2a2113; --notice-text: #f1c98a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014; --band: #151820; --panel: #171b22; --border: #272d37;
  --text: #e9ecf1; --lede: #c4cad3; --muted: #9ba4b1;
  --accent: #8d9bff; --accent-hover: #aab5ff; --on-accent: #0e1014; --accent-soft: #1d2240;
  --ok: #6fd39f; --ok-soft: #12281d; --progress: #f1b562; --progress-soft: #2c2213;
  --idea: #9ba4b1; --idea-soft: #1f242c; --notice: #2a2113; --notice-text: #f1c98a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
main { flex: 1 0 auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
code { font-size: .92em; background: var(--band); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Type: one scale for the whole site. */
h1, h2, h3 { color: var(--text); letter-spacing: -.015em; }
h1 { font-size: clamp(34px, 5vw, 46px); line-height: 1.1; font-weight: 750; letter-spacing: -.025em; margin: 0; }
h2 { font-size: 24px; line-height: 1.25; font-weight: 700; margin: 0; }
h3 { font-size: 18px; line-height: 1.35; font-weight: 650; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lede { font-size: 20px; line-height: 1.55; color: var(--lede); max-width: 680px; margin: 14px 0 0; }
.sub { color: var(--muted); margin: 4px 0 20px; }
.small { font-size: 15px; color: var(--muted); margin: 0; }
.center { text-align: center; }

/* Header */
header.site { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
header.site .wrap { display: flex; align-items: center; gap: 8px 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
header.site nav { display: flex; gap: 4px; margin-left: auto; }
header.site nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: 15px; font-weight: 550; white-space: nowrap; }
header.site nav a:hover { color: var(--text); background: var(--band); }
header.site nav a[aria-current] { color: var(--text); background: var(--band); }

/* Buttons */
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; font-weight: 650; font-size: 16px; line-height: 1.3; text-decoration: none; border: 1px solid transparent; text-align: center; }
.btn.small { padding: 7px 14px; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn.ghost { border-color: var(--border); color: var(--text); background: var(--panel); }
.btn.ghost:hover { border-color: var(--muted); color: var(--text); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 28px 0 14px; }

.tag { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 650; letter-spacing: 0; line-height: 1.4;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 12px; margin-left: 10px; }
h2 .tag { font-size: 13px; padding: 2px 10px; }

/* Every page opens the same way. */
.page-head { background: var(--band); border-bottom: 1px solid var(--border); padding: 64px 0 52px; }
.content { padding: 56px 0 88px; }
.block + .block, .panels + .block, .features + .block { margin-top: 64px; }
.block > h2 + :not(.sub) { margin-top: 20px; }
.next { margin: 48px 0 0; color: var(--muted); }

/* Home */
.notice { background: var(--notice); color: var(--notice-text); font-size: 15px; text-align: center; }
.notice .wrap { padding-top: 10px; padding-bottom: 10px; }
.hero { background: var(--band); text-align: center; padding: 80px 0 170px; }
.hero h1 { max-width: 820px; margin: 0 auto; font-size: clamp(36px, 6vw, 58px); }
.hero .lede { margin: 20px auto 0; }
.showcase { margin-top: -130px; padding-bottom: 88px; }
.shot img { display: block; width: 100%; max-width: 1000px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.wrap.home-start { padding-bottom: 64px; }
.home-start h2 { margin-bottom: 24px; }
.home-start .next { margin-top: 24px; }
ol.quick-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
ol.quick-start > li { margin-bottom: 0; }

/* Short items with a heading: How it works, Privacy */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; }
.feature { border-top: 1px solid var(--border); padding-top: 20px; }
.feature p { color: var(--muted); margin: 0; }

/* Boxes you act on: downloads, contact */
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.panels.one { grid-template-columns: minmax(0, 420px); }
.panels:has(> .panel:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.panel p { color: var(--muted); margin: 0; }
.panel.download { display: flex; flex-direction: column; gap: 12px; }
.panel.download h3 { font-size: 20px; margin: 0; }
.panel .spec { font-size: 15px; min-height: 3.3em; }
.small.center + .block { margin-top: 56px; }
.panel .btn { margin-top: 4px; }
.panels + .small.center { margin-top: 18px; }
/* The visitor's own system (platform.js): its download first and outlined, the others' buttons quieter. */
.panel.yours { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.panel h3 .tag { font-size: 13px; padding: 2px 10px; }
.panels.picked .panel:not(.yours) .btn.primary { background: var(--panel); color: var(--text); border-color: var(--border); }
.panels.picked .panel:not(.yours) .btn.primary:hover { border-color: var(--muted); }
/* Its download is then the one big box across the top, the others smaller in a row under it. */
.panels.picked, .panels.picked:has(> .panel:nth-child(4)) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panels.picked:not(:has(> .panel:nth-child(4))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panels.picked .panel.yours { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 8px 40px; padding: 32px 36px; }
.panels.picked .panel.yours > * { grid-column: 1; }
.panels.picked .panel.yours h3 { font-size: 30px; }
.panels.picked .panel.yours .spec { font-size: 17px; min-height: 0; }
.panels.picked .panel.yours .btn { grid-column: 2; grid-row: 1 / span 4; margin: 0; font-size: 19px; padding: 16px 36px; }
.panels.picked .others { grid-column: 1 / -1; margin: 14px 0 -2px; color: var(--muted); font-size: 15px; }
.panels.picked .panel:not(.yours) { padding: 18px 20px; gap: 8px; }
.panels.picked .panel:not(.yours) h3 { font-size: 17px; }
.panels.picked .panel:not(.yours) .spec { font-size: 14px; min-height: 0; }
.panels.picked .panel:not(.yours) .small { font-size: 13px; }
.panels.picked .panel:not(.yours) .btn { font-size: 15px; padding: 8px 14px; }
.for-device { margin-bottom: 28px; }
.for-device .note { margin: 0; }
.for-device .panels + .small { margin-top: 28px; }

/* Numbered steps */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 16px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.note { margin: 24px 0 0; padding: 16px 20px; background: var(--band); border: 1px solid var(--border); border-radius: 10px; color: var(--lede); font-size: 16px; }
.note p:last-child { margin-bottom: 0; }
.download-trust { margin: 0 0 24px; }

/* Expanding help */
details { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); margin-top: 12px; }
details > summary { cursor: pointer; padding: 14px 20px; font-weight: 650; }
details > div { padding: 0 20px 20px; }
details img { border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; }
details ol.steps { margin: 12px 0; }

/* Roadmap lists: the same columns in every section */
ul.items { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
ul.items li { display: grid; grid-template-columns: 250px 1fr 130px; gap: 4px 24px; align-items: baseline; padding: 16px 22px; border-bottom: 1px solid var(--border); }
ul.items li:last-child { border-bottom: 0; }
ul.items li > b { font-weight: 650; }
ul.items li > span { color: var(--muted); font-size: 16px; }
.pill { justify-self: end; font-style: normal; font-size: 13px; font-weight: 650; white-space: nowrap; border-radius: 999px; padding: 2px 10px; }
.pill.works { color: var(--ok); background: var(--ok-soft); }
.pill.progress { color: var(--progress); background: var(--progress-soft); }
.pill.wish { color: var(--idea); background: var(--idea-soft); }

/* Changelog: version and date on the left, what changed on the right */
.release { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; gap: 0 32px; padding: 32px 0; border-top: 1px solid var(--border); }
.release:first-child { border-top: 0; padding-top: 0; }
.release h2 { grid-column: 1; font-size: 22px; }
.release .date { grid-column: 1; color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.release ul { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding-left: 20px; }
.release li { margin-bottom: 8px; }
.release li::marker { color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--border); background: var(--band); color: var(--muted); font-size: 15px; padding: 32px 0 40px; text-align: center; }
footer nav.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 24px; }
footer nav.foot a { color: var(--muted); text-decoration: none; }
footer nav.foot a:hover { color: var(--text); text-decoration: underline; }
footer .copy { margin: 14px 0 0; font-size: 14px; }

/* The header's links fit on one line only above this width; below it they go on a line of their own. */
@media (max-width: 1000px) {
  header.site .wrap { flex-wrap: wrap; gap: 8px 10px; padding-top: 10px; }
  header.site .theme-pick { margin-left: auto; }
  header.site nav { order: 3; width: calc(100% + 20px); margin: 0 -10px; flex-wrap: wrap; gap: 0 2px; padding-bottom: 8px; }
  header.site nav a { padding: 5px 10px; }
}
@media (max-width: 1000px) and (min-width: 861px) {
  .panels:not(.picked):has(> .panel:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .page-head { padding: 44px 0 36px; }
  .content { padding: 40px 0 64px; }
  .hero { padding: 56px 0 120px; }
  .showcase { margin-top: -90px; padding-bottom: 56px; }
  ol.quick-start { grid-template-columns: minmax(0, 1fr); }
  .features, .panels, .panels:has(> .panel:nth-child(4)) { grid-template-columns: minmax(0, 1fr); }
  .panels.one { grid-template-columns: minmax(0, 1fr); }
  .panels.picked, .panels.picked:has(> .panel:nth-child(4)),
  .panels.picked:not(:has(> .panel:nth-child(4))) { grid-template-columns: minmax(0, 1fr); }
  .panels.picked .panel.yours { display: flex; padding: 24px; }
  .panels.picked .panel.yours h3 { font-size: 26px; }
  .panels.picked .panel.yours .btn { padding: 14px 20px; }
  .panel .spec { min-height: 0; }
  ul.items li { grid-template-columns: 1fr auto; padding: 14px 18px; }
  ul.items li > b { grid-column: 1; grid-row: 1; }
  ul.items li > .pill { grid-column: 2; grid-row: 1; }
  ul.items li > span { grid-column: 1 / -1; grid-row: 2; }
  .release { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .release ul { grid-column: 1; grid-row: auto; margin-top: 14px; }
}

/* The theme menu: System, Light or Dark. It needs the script, so it shows only when the script ran.
   The button shows the current choice; the colors follow data-theme, or the system when it is absent. */
.theme-pick { display: none; position: relative; }
.js .theme-pick { display: block; }
button.theme { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; }
button.theme:hover, button.theme[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
button.theme svg { width: 18px; height: 18px; display: none; }
:root:not([data-theme-choice]) button.theme .system, [data-theme-choice="system"] button.theme .system,
[data-theme-choice="light"] button.theme .light, [data-theme-choice="dark"] button.theme .dark { display: block; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 150px; padding: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.theme-menu[hidden] { display: none; }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.theme-menu button:hover { background: var(--band); }
.theme-menu button svg { width: 16px; height: 16px; color: var(--muted); }
.theme-menu button[aria-pressed="true"] { color: var(--accent); font-weight: 650; }
.theme-menu button[aria-pressed="true"] svg { color: var(--accent); }

/* The app's picture matches the page. */
.shot .dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot .light { display: none; }
  :root:not([data-theme="light"]) .shot .dark { display: block; }
}
:root[data-theme="dark"] .shot .light { display: none; }
:root[data-theme="dark"] .shot .dark { display: block; }

@media (max-width: 380px) {
  .wrap { padding: 0 16px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand img { width: 26px; height: 26px; }
  header.site .btn.small { padding: 7px 12px; }
}

@media (pointer: coarse) {
  header.site .brand, header.site nav a, header.site .btn { min-height: 44px; display: inline-flex; align-items: center; }
  button.theme { width: 44px; height: 44px; }
  .theme-menu button { min-height: 44px; }
  footer nav.foot a { min-height: 44px; display: inline-flex; align-items: center; }
}
