/* FlipFix's download and setup page. Colours from the app icon: plum ground, coral play mark. */
:root {
  --bg: #f7f5f8;
  --surface: #ffffff;
  --surface-2: #f0edf2;
  --ink: #1c1820;
  --ink-2: #5d5764;
  --line: #e3dee7;
  --plum: #26202a;
  --accent: #c8323a;          /* the icon's coral, darkened for white text */
  --accent-ink: #ffffff;
  --accent-soft: #fbe9ea;
  --ok: #1f7a4d;
  --warn: #a5560c;
  --fail: #b3261e;
  --focus: #2f6bde;
  --radius: 18px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgb(28 24 32 / 6%), 0 8px 24px rgb(28 24 32 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141116;
    --surface: #1e1a21;
    --surface-2: #29242d;
    --ink: #f3f0f5;
    --ink-2: #b2abb8;
    --line: #342e39;
    --accent: #ff6b70;
    --accent-ink: #1a1418;
    --accent-soft: #3a2226;
    --ok: #5fd39a;
    --warn: #f2a65a;
    --fail: #ff8a80;
    --focus: #7aa7ff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

b, strong { font-weight: 650; }
code, pre { font-family: var(--mono); font-size: 0.86em; }

.top, main, .foot { width: min(720px, 100% - 32px); margin-inline: auto; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.brand img { border-radius: 7px; display: block; }
.top-link { font-size: 0.92rem; color: var(--ink-2); }

/* Hero */
.hero { padding: 40px 0 56px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-weight: 650; font-size: 0.92rem; letter-spacing: 0.01em; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 750; text-wrap: balance; }
.lede { margin: 20px 0 0; font-size: 1.13rem; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.meta { margin: 18px 0 0; color: var(--ink-2); font-size: 0.92rem; }
.caution { margin: 22px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-s); font-size: 0.93rem; color: var(--ink-2); }
.caution strong { color: var(--warn); }
.demo { margin: 32px 0 0; }
.demo video { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--plum); }
.demo figcaption { margin-top: 10px; color: var(--ink-2); font-size: 0.88rem; text-align: center; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.quiet:hover { border-color: var(--ink-2); }
.button.small { min-height: 40px; padding: 0 16px; font-size: 0.94rem; }
.button[disabled] { opacity: 0.55; cursor: default; transform: none; }

/* Sections */
section { scroll-margin-top: 16px; }
h2 { margin: 0 0 8px; font-size: 1.6rem; letter-spacing: -0.015em; line-height: 1.2; font-weight: 720; }
h3 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.3; font-weight: 680; }
.intro { margin: 0 0 24px; color: var(--ink-2); }
.install, .help, .facts { padding: 8px 0 48px; }

.notice { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--accent-soft); }
.notice p { margin: 0; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.step {
  counter-increment: step; position: relative;
  padding: 20px 20px 20px 68px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.step::before {
  content: counter(step); position: absolute; left: 20px; top: 18px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--plum); color: #fff; font-weight: 700; font-size: 0.95rem;
}
@media (prefers-color-scheme: dark) { .step::before { background: var(--surface-2); color: var(--ink); } }
.step p { margin: 0; color: var(--ink-2); }
.step p + p { margin-top: 10px; }
.step b { color: var(--ink); }
.step-install { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.step-install::before { background: var(--accent); color: var(--accent-ink); }
.step-install .button { margin-top: 16px; }

.path { white-space: normal; color: var(--ink); font-weight: 600; }
.path i { font-style: normal; color: var(--ink-2); font-weight: 400; margin: 0 0.3em; }

.finish { margin: 4px 0 12px; padding-left: 1.1em; color: var(--ink-2); display: grid; gap: 6px; }

/* Progress panel */
.panel { margin-top: 18px; padding: 16px; border-radius: var(--radius-s); background: var(--surface-2); }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tasks li { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: start; color: var(--ink-2); }
.tasks .label { font-weight: 600; }
.tasks .detail { grid-column: 2; font-size: 0.9rem; }
.tasks .detail:empty { display: none; }
.mark { width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--line); }
.tasks li[data-state="active"] { color: var(--ink); }
.tasks li[data-state="active"] .mark { border-color: var(--accent); border-right-color: transparent; animation: spin 0.8s linear infinite; }
.tasks li[data-state="done"] { color: var(--ink); }
.tasks li[data-state="done"] .mark { border: 0; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.tasks li[data-state="warn"] .mark { border-color: var(--warn); background: var(--warn); }
.tasks li[data-state="fail"] { color: var(--ink); }
.tasks li[data-state="fail"] .mark { border: 0; background: var(--fail) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 6l6 6M12 6l-6 6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/18px no-repeat; }
@media (prefers-reduced-motion: reduce) { .tasks li[data-state="active"] .mark { animation: none; border-right-color: var(--accent); } }
@keyframes spin { to { transform: rotate(360deg); } }

.status:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.status p { margin: 0; color: var(--ink); }
.status p + p { margin-top: 8px; }
.status .error { color: var(--fail); font-weight: 600; }
.status .success { color: var(--ok); font-weight: 650; }
.status code { word-break: break-word; }
.status .technical { color: var(--ink-2); font-size: 0.85rem; font-family: var(--mono); word-break: break-word; }
.choice { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Help */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 14px 0; font-weight: 620; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-2); font-weight: 400; font-size: 1.2em; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 16px; color: var(--ink-2); }
.help h2 { margin-bottom: 16px; }

/* Facts */
.facts p { color: var(--ink-2); margin: 0 0 14px; }
.facts pre { margin: 0 0 14px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-s); overflow-x: auto; line-height: 1.6; }

/* Footer */
.foot { padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.88rem; }
.foot p { margin: 0 0 8px; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding: 24px 0 40px; }
  .step { padding: 18px 16px 18px 58px; }
  .step::before { left: 14px; top: 16px; width: 30px; height: 30px; }
  .cta .button { flex: 1 1 100%; }
}
