/* trove site — folio family language: parchment, cinnabar, one serif, hairline rules. */

:root {
  --page: #f6f0ea;
  --card: #fbf7f3;
  --rule: #e6dacd;
  --ink: #191514;
  --ink-warm: #3a312d;
  --muted: #756a63;
  --accent: #b83d2e;
  --max: 1120px;
  --serif: "Source Serif 4", Charter, Georgia, "Songti SC", "Noto Serif CJK SC", "STSong", Palatino, serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Songti SC", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }
a { color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: #f1e8de;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--ink);
  color: var(--page);
  padding: 10px 14px;
  border-radius: 4px;
  text-decoration: none;
}
.skip:focus { top: 16px; }

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

.wrap {
  width: min(calc(100% - 72px), var(--max));
  margin: 0 auto;
}

#top,
#system,
#workspace,
#tagging,
#privacy,
#install,
#download {
  scroll-margin-top: 88px;
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(calc(100% - 72px), var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 25px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.top nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
}

.top nav a {
  text-decoration: none;
  color: var(--ink-warm);
}

.top nav a:hover { color: var(--accent); }

.langs {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1;
}

.langs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--serif);
  padding: 7px 10px;
  cursor: pointer;
}

.langs button + button { border-left: 1px solid var(--rule); }
.langs button[aria-pressed="true"] { background: var(--accent); color: #fdf9f4; }

.repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink-warm);
  transition: color 140ms ease, border-color 140ms ease;
}

.repo-link svg { width: 15px; height: 15px; display: block; }
.repo-link:hover { color: var(--accent); border-color: var(--muted); }

/* ---------- shared type ---------- */

.kicker,
.section-note,
.meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-note { color: var(--accent); }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(44px, 5.4vw, 64px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

html[lang="zh-CN"] h1 {
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

html[lang="zh-CN"] h2 {
  font-size: clamp(26px, 3.1vw, 38px);
  letter-spacing: -0.005em;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

p { color: var(--ink-warm); }

.lede {
  max-width: 33em;
  margin: 26px 0 30px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-warm);
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  font-size: 15.5px;
  background: transparent;
  color: var(--ink);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button small {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf9f4;
}

.button.primary small { color: #f0d8d1; }
.button.primary:hover { background: #a33426; border-color: #a33426; }
.button:not(.primary):hover { border-color: var(--ink-warm); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(32px, 4.5vw, 56px);
  align-items: center;
  padding: clamp(56px, 7vw, 92px) 0 84px;
}

.hero .kicker { margin-bottom: 22px; }
.hero .meta { margin: 0; }

figure { margin: 0; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
}

figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* ---------- statement ---------- */

.statement {
  padding: 74px 0 70px;
  border-top: 1px solid var(--rule);
  max-width: 52em;
}

.statement-line {
  margin-bottom: 22px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

html[lang="zh-CN"] .statement-line { font-size: clamp(24px, 2.9vw, 36px); }

.statement-body {
  max-width: 40em;
  margin-bottom: 0;
  font-size: 17.5px;
  color: var(--ink-warm);
}

/* ---------- index table ---------- */

.system {
  padding: 70px 0 76px;
  border-top: 1px solid var(--rule);
}

.system-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  margin-bottom: 34px;
}

.system-head h2 { margin-bottom: 0; }
.system-head p { margin-bottom: 4px; max-width: 32em; }

.rows {
  border-top: 1px solid var(--rule);
}

.row {
  display: grid;
  grid-template-columns: 56px 190px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.row .name { font-size: 19px; }

.row p {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

/* ---------- split sections ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: 84px 0;
  border-top: 1px solid var(--rule);
}

.split.reverse { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
.split.reverse .copy { order: 2; }
.split.reverse figure { order: 1; }

.split p { max-width: 30em; color: var(--ink-warm); }

.points {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
  counter-reset: point;
}

.points li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-warm);
}

.points li::before {
  content: counter(point, decimal-leading-zero);
  counter-increment: point;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding-top: 3px;
}

/* ---------- privacy ---------- */

.privacy {
  padding: 76px 0 80px;
  border-top: 1px solid var(--rule);
}

.privacy h2 { max-width: 22em; }

.privacy-panel {
  max-width: 62em;
  margin-top: 28px;
  padding: 30px 34px 26px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.privacy-lede {
  max-width: 44em;
  margin-bottom: 30px;
  color: var(--ink-warm);
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 36px;
}

.privacy-grid > div {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.privacy h3 { font-size: 18px; }

.privacy-grid p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.privacy-sample {
  max-width: 52em;
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- install ---------- */

.install {
  padding: 82px 0 76px;
}

.install-head { max-width: 38em; margin-bottom: 34px; }

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.steps li {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.step-number {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.steps h3 { font-size: 18px; }
.steps p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- download ---------- */

.download {
  padding: 76px 0 84px;
  border-top: 1px solid var(--rule);
}

.download-head { max-width: 40em; margin-bottom: 30px; }

.download-list {
  border-top: 1px solid var(--rule);
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: color 140ms ease;
}

.download-row:hover .platform { color: var(--accent); }
.download-row:hover .file { color: var(--ink-warm); }

.platform { font-size: 19px; }
.file { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.get {
  justify-self: end;
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}

.download-note {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.download-all {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-size: 14px;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.download-all:hover { color: var(--ink); }

/* ---------- footer ---------- */

footer {
  width: min(calc(100% - 72px), var(--max));
  margin: 0 auto;
  padding: 26px 0 40px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 19px;
}

.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }

footer p { margin: 0; color: var(--muted); }

footer nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

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

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero figure { animation: rise 720ms 60ms cubic-bezier(0.22, 1, 0.36, 1) both; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- narrow ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .system-head { grid-template-columns: 1fr; align-items: start; }
  .split,
  .split.reverse { grid-template-columns: 1fr; padding: 60px 0; }
  .split.reverse .copy,
  .split.reverse figure { order: initial; }
  .privacy-grid { grid-template-columns: 1fr; gap: 0; }
  .privacy-grid > div { padding: 16px 0; border-top: 1px solid var(--rule); }
  .steps { grid-template-columns: 1fr; }
  .row { grid-template-columns: 40px minmax(0, 1fr); gap: 6px 18px; }
  .row p { grid-column: 2; }
}

@media (max-width: 680px) {
  .wrap,
  .top,
  .privacy .wrap,
  footer { width: min(calc(100% - 36px), var(--max)); }

  .top { gap: 12px; padding: 12px 0; }
  .top nav { display: none; }
  .langs { margin-left: auto; }

  h1 { font-size: clamp(38px, 10.6vw, 54px); }
  html[lang="zh-CN"] h1 { font-size: clamp(30px, 8.4vw, 44px); }
  .lede { font-size: 17.5px; }
  .actions { flex-direction: column; }
  .button { width: 100%; justify-content: space-between; }

  .hero { padding-bottom: 60px; }
  .statement { padding: 56px 0; }
  .system, .install, .download { padding: 56px 0; }
  .privacy { padding: 56px 0; }
  .privacy-panel { padding: 22px 20px 20px; }

  .download-row {
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
  }
  .file { grid-column: 1 / -1; }

  footer { flex-wrap: wrap; gap: 12px 18px; }
  footer p { flex-basis: 100%; order: 3; }
  footer nav { margin-left: 0; gap: 16px; }
}
