/* Parapaper — product page. System fonts only: nothing is fetched from
   another origin. Colours follow the app icon (navy panes, sky-blue lines). */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --border: #e2e8f0;
  --accent: #0369a1;
  --accent-soft: #e0f2fe;
  --btn-bg: #0f172a;
  --btn-text: #ffffff;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 12px 32px -12px rgb(15 23 42 / 22%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --text: #e2e8f0;
    --muted: #a5b4c8;
    --faint: #8a9ab0;
    --border: #22304a;
    --accent: #38bdf8;
    --accent-soft: #0c2a40;
    --btn-bg: #38bdf8;
    --btn-text: #0b1120;
    --code-bg: #060b16;
    --code-text: #dbe4f0;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px -16px rgb(0 0 0 / 70%);
    color-scheme: dark;
  }
}

/* --- Language toggle: both languages are in the page; one is shown. ----- */
html[data-lang="en"] [data-l="zh"],
html[data-lang="zh"] [data-l="en"] {
  display: none !important;
}
html:not(.js) .lang-toggle {
  display: none;
}

/* --- Base ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  overflow-wrap: break-word;
}

:lang(zh-Hant) {
  line-height: 1.8;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code {
  font: 0.88em/1.5 ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

.wrap {
  max-width: 1104px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 8px 12px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 8px;
  z-index: 20;
}
.skip:focus {
  top: 8px;
}

/* --- Header -------------------------------------------------------------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.brand img {
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav a:hover {
  color: var(--text);
}

.lang-toggle {
  margin-left: 4px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover {
  border-color: var(--accent);
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding: 72px 0 40px;
}

.pill {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  letter-spacing: -0.03em;
}

.tagline {
  margin: 14px 0 0;
  max-width: 22em;
  font-size: clamp(1.3rem, 2.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.35;
}

.lede {
  margin: 18px 0 0;
  max-width: 40em;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent);
}
.btn.primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}
.btn.primary:hover {
  filter: brightness(1.12);
}

/* --- Sections ------------------------------------------------------------ */
section {
  padding: 56px 0;
}

.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

/* --- Screenshots --------------------------------------------------------- */
.shots {
  padding-top: 24px;
}

.shot {
  margin: 0;
}
.shot > a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #fff;
}
.shot figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}
.shot figcaption strong {
  color: var(--text);
}
.source {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--faint);
}

.shot-pair {
  display: grid;
  gap: 32px;
  margin-top: 40px;
}

.credit {
  margin: 36px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--faint);
}

/* --- Features ------------------------------------------------------------ */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.card h3 {
  font-size: 1.08rem;
  margin: 12px 0 8px;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ico {
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 8px;
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- How it works -------------------------------------------------------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 22px 22px 22px 70px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 20px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
}
.steps h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- Status -------------------------------------------------------------- */
.badges {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.badges li {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 600;
}
.status p {
  margin: 0;
  max-width: 44em;
}

/* --- Self-host ----------------------------------------------------------- */
.selfhost-inner {
  display: grid;
  gap: 28px;
}
/* Grid items default to their min-content width, so the long `git clone`
   line widened the whole page on a phone instead of scrolling in its box. */
.selfhost-inner > * {
  min-width: 0;
}
.selfhost-inner > div > p {
  margin: 0 0 18px;
  max-width: 38em;
  color: var(--muted);
}

.code {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  overflow-x: auto;
}
.code code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
  white-space: pre;
}

.keys {
  align-self: start;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
}
.keys h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}
.keys p,
.keys li {
  color: var(--muted);
  font-size: 0.95rem;
}
.keys p {
  margin: 0 0 10px;
}
.keys ul {
  margin: 0;
  padding-left: 1.1em;
}
.keys li + li {
  margin-top: 8px;
}

/* --- Footer -------------------------------------------------------------- */
.foot {
  margin-top: 24px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.foot p {
  margin: 0 0 6px;
}

/* --- Wider screens ------------------------------------------------------- */
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 760px) {
  .shot-pair {
    grid-template-columns: 1fr 1fr;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .steps li {
    padding: 70px 22px 22px;
  }
}

@media (min-width: 900px) {
  .selfhost-inner {
    grid-template-columns: 1.15fr 1fr;
    gap: 40px;
  }
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero {
    padding: 96px 0 48px;
  }
  section {
    padding: 72px 0;
  }
}

/* --- Narrow screens ------------------------------------------------------ */
@media (max-width: 719px) {
  .nav {
    display: none;
  }
  .lang-toggle {
    margin-left: auto;
  }
}

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