/* ELF repository — frontend design system
   Space Grotesk (UI) + JetBrains Mono (identifiers). ELF royal-blue accent. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --ink: #0e1726;
  --muted: #596274;
  --line: #e6e8ee;
  --brand: #2d4cff;
  --brand-ink: #1a2fb8;
  --brand-wash: #eef1ff;
  --ok: #0f9d58;
  --ok-wash: #e6f6ee;
  --warn: #c9781a;
  --warn-wash: #fbf0df;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 760px;
  --shadow: 0 1px 2px rgba(14,23,38,.04), 0 8px 24px rgba(14,23,38,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1e;
    --surface: #121a2e;
    --surface-2: #0f1627;
    --ink: #e7ecf7;
    --muted: #8793a8;
    --line: #212c44;
    --brand: #6a82ff;
    --brand-ink: #9fb0ff;
    --brand-wash: #1a2446;
    --ok: #34c77b;
    --ok-wash: #11301f;
    --warn: #e0a150;
    --warn-wash: #332411;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1e; --surface: #121a2e; --surface-2: #0f1627; --ink: #e7ecf7;
  --muted: #8793a8; --line: #212c44; --brand: #6a82ff; --brand-ink: #9fb0ff;
  --brand-wash: #1a2446; --ok: #34c77b; --ok-wash: #11301f; --warn: #e0a150; --warn-wash: #332411;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 72px; }

/* ---- hero / repo identity ---- */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  align-items: start;
}
.hero__icon { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; background: var(--surface-2); }
.hero__name { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.hero__desc { color: var(--muted); margin: 6px 0 16px; }
.hero__count { color: var(--muted); font-size: 14px; margin-top: 14px; }
.hero__count b { color: var(--ink); font-weight: 700; }

/* source URL chip */
.source {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); overflow: hidden; max-width: 100%;
}
.source__url {
  padding: 11px 14px; font-size: 14px; color: var(--ink);
  overflow-x: auto; white-space: nowrap; flex: 1; display: flex; align-items: center;
}
.source__copy {
  border: 0; border-left: 1px solid var(--line); background: transparent;
  color: var(--brand-ink); font: inherit; font-weight: 600; font-size: 13px;
  padding: 0 16px; cursor: pointer; white-space: nowrap;
}
.source__copy:hover { background: var(--brand-wash); }
.source__copy.copied { color: var(--ok); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-ink); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; filter: none; }
.btn--block { width: 100%; justify-content: center; }

/* ---- section heading ---- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 2px 12px; }
.sec-head h2 { font-size: 15px; font-weight: 700; letter-spacing: .01em; margin: 0; }
.sec-head .sub { color: var(--muted); font-size: 13px; }

/* ---- package list ---- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pkg { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.pkg:first-child { border-top: 0; }
.pkg:hover { background: var(--surface-2); text-decoration: none; }
.mono-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 19px; color: #fff; }
.pkg__name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.pkg__id { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pkg__right { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }
.pkg__ver { color: var(--ink); font-weight: 600; }
.pkg__chev { color: var(--muted); }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

/* ---- depiction ---- */
.dep-head { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.dep-head .mono-icon { width: 76px; height: 76px; border-radius: 19px; font-size: 30px; }
.dep-title { font-size: 25px; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
.dep-id { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dep-sub { color: var(--muted); font-size: 14px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dep-sub .mono { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-top: 16px; }
.card h3 { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.prose { color: var(--ink); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 24px; }
.meta div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meta dt { color: var(--muted); font-size: 14px; }
.meta dd { margin: 0; font-weight: 600; text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill--ok { background: var(--ok-wash); color: var(--ok); }
.pill--warn { background: var(--warn-wash); color: var(--warn); }
.pill--brand { background: var(--brand-wash); color: var(--brand-ink); }

.shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.shots img { height: 300px; border-radius: 14px; border: 1px solid var(--line); scroll-snap-align: start; }

.backlink { display: inline-flex; align-items: center; gap: 6px; margin: 22px 2px 0; color: var(--muted); font-size: 14px; }

footer.repo-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
footer.repo-foot .mono { color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .wrap { padding: 18px 14px 56px; }
  .hero { grid-template-columns: 56px 1fr; gap: 14px; padding: 18px; }
  .hero__icon { width: 56px; height: 56px; border-radius: 14px; }
  .hero__name { font-size: 26px; }
  .dep-head { grid-template-columns: 60px 1fr; padding: 16px; }
  .dep-head .mono-icon { width: 60px; height: 60px; font-size: 24px; }
  .dep-title { font-size: 21px; }
  .meta { grid-template-columns: 1fr; }
  .shots img { height: 230px; }
}
@media (prefers-reduced-motion: no-preference) {
  .pkg, .btn, .source__copy { transition: background .15s ease, color .15s ease, border-color .15s ease; }
}
