/* PlainVM marketing site — self-contained, no external dependencies. */

:root {
  --bg: #ffffff;
  --bg-elev: #f5f5f7;
  --bg-sunken: #fafafc;
  --text: #1d1d1f;
  --text-muted: #5c5c61;
  --text-faint: #6e6e73;
  --accent: #0064d2;
  --accent-soft: rgba(0, 100, 210, 0.08);
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.07);
  --ok: #17803d;
  --warn: #9a5b00;
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elev: #131316;
    --bg-sunken: #0a0a0c;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --text-faint: #86868b;
    --accent: #4da3ff;
    --accent-soft: rgba(77, 163, 255, 0.12);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.55);
    --ok: #4ad07a;
    --warn: #f0b429;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* keep anchor targets clear of the sticky header */
  scroll-padding-top: 96px;
}
:target { scroll-margin-top: 96px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

code, kbd, samp, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--bg-elev); padding: 0.12em 0.4em; border-radius: 5px; }
pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}

/* ---------- language switching ---------- */
:root[data-lang="en"] .lang-zh,
:root[data-lang="zh"] .lang-en { display: none !important; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 650; }
h3 { font-size: 20px; font-weight: 620; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(17px, 2vw, 21px); color: var(--text-muted); max-width: 62ch; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 660;
  color: var(--accent);
  margin: 0 0 12px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.site-nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--text-muted); font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
}
.lang-toggle button {
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
/* round the children rather than clipping the parent, so focus outlines survive */
.lang-toggle button:first-child { border-radius: 999px 0 0 999px; }
.lang-toggle button:last-child { border-radius: 0 999px 999px 0; }
.lang-toggle button:focus-visible { outline-offset: -2px; z-index: 1; }
.lang-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 84px 0 64px; text-align: center; }
.hero-icon {
  width: 108px;
  height: 108px;
  margin: 0 auto 26px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: 18px; }
.hero .lede { margin: 0 auto 28px; }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.badge {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 5px 12px;
}

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 560;
  font-size: 16px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { border-color: var(--border-strong); color: var(--text); background: var(--bg); }
.btn-secondary:hover { background: var(--bg-elev); }

/* ---------- app window mock ---------- */
.mock {
  margin: 56px auto 0;
  max-width: 900px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 60%, var(--bg));
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.mock-title { margin-left: 10px; font-size: 13px; color: var(--text-faint); }
.mock-body { display: grid; grid-template-columns: 210px 1fr; min-height: 300px; }
.mock-side { border-right: 1px solid var(--border); padding: 12px; background: var(--bg-sunken); }
.mock-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-muted);
}
.mock-row.active { background: var(--accent-soft); color: var(--text); font-weight: 560; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.status-dot.run { background: var(--ok); }
.mock-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.mock-screen {
  flex: 1;
  min-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(0, 100, 210, 0.20), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(120, 60, 220, 0.18), transparent 60%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
}
.mock-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
}

/* ---------- grids & cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg-elev);
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); font-size: 15.5px; }
.card .ico {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  color: var(--accent);
}
.card .ico svg { width: 100%; height: 100%; }

ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--text-muted);
}
ul.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  min-width: 520px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { font-weight: 620; color: var(--text); background: var(--bg-elev); }
td { color: var(--text-muted); }

/* ---------- notes ---------- */
.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--text-muted);
  font-size: 15.5px;
}
.note.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.note :last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
details.faq {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  margin-bottom: 10px;
  background: var(--bg-elev);
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 30px 16px 0;
  font-weight: 560;
  position: relative;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 14px;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-faint);
}
details.faq[open] summary::after { content: "\2013"; }
details.faq .faq-body { padding-bottom: 16px; color: var(--text-muted); font-size: 15.5px; }
details.faq .faq-body :last-child { margin-bottom: 0; }

/* ---------- legal documents ---------- */
.doc { max-width: 760px; }
.doc h2 { margin-top: 44px; font-size: 24px; }
.doc h3 { margin-top: 26px; font-size: 18px; }
.doc ul, .doc ol { padding-left: 22px; color: var(--text-muted); }
.doc li { margin-bottom: 8px; }
.doc p { color: var(--text-muted); }
.doc .meta {
  font-size: 14px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 28px;
  background: var(--bg-elev);
}
.toc {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  background: var(--bg-elev);
  margin-bottom: 34px;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 42px 0 56px;
  color: var(--text-faint);
  font-size: 14px;
  background: var(--bg-sunken);
}
.footer-cols { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 28px; }
.footer-cols h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 7px; }
.footer-cols a { color: var(--text-muted); }
.legal-lines p { margin: 0 0 6px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 700px) {
  section { padding: 52px 0; }
  .hero { padding: 56px 0 44px; }
  .mock-body { grid-template-columns: 1fr; }
  .mock-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .site-nav { gap: 14px; width: 100%; margin-left: 0; order: 3; padding-bottom: 10px; }
}

@media print {
  /* force the light palette and true black text on paper, whatever the screen scheme is */
  :root {
    --bg: #fff;
    --bg-elev: #fff;
    --bg-sunken: #fff;
    --text: #000;
    --text-muted: #000;
    --text-faint: #333;
    --accent: #000;
    --accent-soft: transparent;
    --border: rgba(0, 0, 0, 0.3);
    --border-strong: rgba(0, 0, 0, 0.5);
    --shadow: none;
  }
  .site-header, .site-footer, .lang-toggle, .cta-row, .skip-link { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; }
  .doc h2, .doc h3 { break-after: avoid; }
  details.faq { break-inside: avoid; }
}
