:root {
  --paper: #FAF9F5;
  --raised: #F0EEE6;
  --sunk: #E8E6DC;
  --ink: #141413;
  --ink-soft: #5E5D59;
  --clay: #D97757;
  --rim: #B9573A;
  --seed: #E9A23B;
  --line: #E3E0D5;
  --latin: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --cjk: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #262624;
    --raised: #30302E;
    --sunk: #3D3D3A;
    --ink: #FAF9F5;
    --ink-soft: #B5B3AA;
    --line: #3D3D3A;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
.hero > *, .download > *, .feats > * { min-width: 0; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 var(--cjk);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--seed); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.latin { font-family: var(--latin); }
.nowrap { white-space: nowrap; }

/* Top bar */
header.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 22px/1 var(--latin); letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; }
.top nav { display: flex; gap: 22px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav { align-items: center; }
.top nav a.lang { white-space: nowrap; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
body.en { font-family: var(--latin), var(--cjk); }
body.en .hero h1 { font-size: clamp(30px, 4.1vw, 52px); }
.top nav a { white-space: nowrap; }
header.top { gap: 12px; }
.ui-note { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }
.top nav a.get { padding: 7px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; }
.top nav a.get:hover { color: var(--paper); opacity: .88; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 48px 0 72px; }
.hero h1 {
  margin: 0 0 22px;
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 66px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.hero p.lede { margin: 0 0 32px; font-size: 19px; color: var(--ink-soft); max-width: 30em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 17px; text-decoration: none;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.cta small { color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

/* The basket: link slips drop in once on load */
.stash { position: relative; height: 440px; }
.stash .basket { position: absolute; left: 50%; bottom: 0; width: 360px; transform: translateX(-50%); z-index: 2; }
.slip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.slip {
  position: absolute; z-index: 1; left: 50%; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 14px; border-radius: 12px;
  background: var(--raised); border: 1px solid var(--line);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px -10px rgba(60, 40, 20, .45);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  animation: drop .9s cubic-bezier(.3, .0, .3, 1.25) both;
  animation-delay: var(--d);
}
@keyframes drop {
  from { opacity: 0; transform: translate(var(--x), calc(var(--y) - 320px)) rotate(calc(var(--r) * -2)); }
  25% { opacity: 1; }
}
.seed { position: absolute; z-index: 3; width: 46px; left: calc(50% + 96px); top: 40px;
  animation: bob 4s ease-in-out 2.2s infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) {
  .slip, .seed { animation: none; }
}

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
section h2 { margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.25; font-weight: 700; }
section .sub { margin: 0 0 40px; color: var(--ink-soft); max-width: 36em; }

/* Library preview, built in HTML so no real collection is exposed */
.window {
  border-radius: 14px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(60, 40, 20, .35);
}
.titlebar { display: flex; gap: 8px; padding: 14px 16px; }
.titlebar b { width: 12px; height: 12px; border-radius: 50%; background: var(--sunk); }
.app { display: grid; grid-template-columns: 180px 1fr; min-height: 420px; }
.side { padding: 6px 12px 20px; font-size: 14px; }
.side div { padding: 6px 10px; border-radius: 8px; color: var(--ink-soft); }
.side div.on { background: color-mix(in srgb, var(--clay) 16%, transparent); color: var(--ink); font-weight: 600; }
.side h4 { margin: 18px 10px 6px; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.grid { columns: 4 150px; column-gap: 14px; padding: 4px 18px 18px 6px; }
.card { break-inside: avoid; margin-bottom: 14px; }
.cover { border-radius: 10px; background: var(--bg); position: relative; }
.card p { margin: 6px 2px 0; font-size: 13px; line-height: 1.4; font-weight: 600; }
.card small { display: block; margin: 2px 2px 0; font-size: 12px; color: var(--ink-soft); }

/* Features: plain two-column list, not cards */
.feats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 44px 56px; margin-top: 8px; }
.feat h3 { margin: 0 0 6px; font-size: 20px; }
.feat p { margin: 0; color: var(--ink-soft); }
kbd {
  display: inline-block; min-width: 1.8em; padding: 1px 7px; margin: 0 1px;
  border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  background: var(--raised); font: 600 14px/1.5 var(--latin), var(--cjk); text-align: center;
}

/* Download + install (a real sequence, so numbered) */
.download { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.meta { margin-top: 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.8; }
.meta code { font: 12px/1.5 ui-monospace, Menlo, monospace; word-break: break-all; }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 26px 52px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--clay); color: #fff; font: 700 17px/34px var(--latin); text-align: center;
}
ol.steps h3 { margin: 2px 0 4px; font-size: 18px; }
ol.steps p { margin: 0; color: var(--ink-soft); }
.note { margin-top: 6px; padding: 18px 20px; border-radius: 12px; background: var(--raised); font-size: 15px; }
.note p { margin: 0 0 10px; }
pre { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--paper); overflow-x: auto; font: 13px/1.5 ui-monospace, Menlo, monospace; }
.copy { margin-top: 10px; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--ink); color: var(--paper); font: 600 13px/1.4 var(--cjk); cursor: pointer; }

details { border-top: 1px solid var(--line); padding: 16px 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--ink-soft); }

footer a { color: var(--ink); text-underline-offset: 3px; }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.sub a, .packet a { color: var(--ink); text-underline-offset: 3px; }
footer { padding: 40px 0 56px; color: var(--ink-soft); font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 860px) {
  .hero, .download { grid-template-columns: 1fr; }
  .hero { padding-top: 16px; gap: 8px; }
  .stash { height: 360px; order: -1; }
  .stash .basket { width: 280px; }
  .feats { grid-template-columns: 1fr; gap: 32px; }
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid { padding: 4px 14px 14px; columns: 2 130px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .top nav a.wide { display: none; }
  .top nav { gap: 12px; }
  .brand { font-size: 20px; }
  .stash { transform: scale(.86); transform-origin: center bottom; height: 320px; }
  section { padding: 56px 0; }
}

/* Plugin market */
.market-head { padding: 40px 0 56px; max-width: 40em; }
.market-head h1 { margin: 0 0 18px; font-size: clamp(36px, 5.6vw, 64px); line-height: 1.15; font-weight: 700; }
.market-head p { margin: 0 0 12px; font-size: 19px; color: var(--ink-soft); }
.market-head .how { font-size: 16px; color: var(--ink); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; padding-bottom: 72px; }
.packet {
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--raised); border: 1px solid var(--line); text-decoration: none; color: inherit;
}
.packet .band { position: relative; height: 132px; background: var(--clay); display: grid; place-items: center; }
.packet .band svg { width: 64px; height: 64px; color: #fff; }
.packet .badge { position: absolute; top: 14px; left: 14px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--rim); font-size: 13px; font-weight: 600; }
.packet .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.packet h3 { margin: 0; font-size: 20px; }
.packet p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.packet .tags { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; }
.packet .tags span { padding: 1px 10px; border-radius: 999px; background: var(--paper); font: 500 13px/1.7 var(--latin), var(--cjk); }
a.packet { transition: transform .15s ease; }
a.packet:hover { transform: translateY(-2px); }
.packet.empty { background: transparent; border: 2px dashed var(--line); justify-content: center; padding: 28px; min-height: 280px; }
.packet.empty h3 { font-size: 18px; }
.detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.facts { margin: 24px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 32px; } .packet.empty { min-height: 0; } }
