/* dacker.ir — design A "Calm": warm paper, generous whitespace, one orange accent. */

:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #625d55;
  --line: #e6e1d6;
  --line-strong: #cfc8b9;
  --accent: #e8590c;
  --accent-text: #a93f00;
  --on-accent: #1c1b19;
  --opt-bg: #ffffff;
  --opt-hover: #f1ede4;
  --label-bg: #f1ede4;
  --code-bg: #efebe2;
  --term-bg: #1c1b19;
  --term-fg: #efebe2;
  --term-muted: #a39d92;
  --term-line: #34322e;
  --term-accent: #ff7a2e;
  --max: 58rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1a1a18;
    --text: #edeae3;
    --muted: #a39d92;
    --line: #2a2926;
    --line-strong: #3d3b36;
    --accent: #ff6b1a;
    --accent-text: #ff8a3d;
    --on-accent: #121211;
    --opt-bg: #1a1a18;
    --opt-hover: #232220;
    --label-bg: #1f1e1c;
    --code-bg: #262522;
    --term-bg: #0a0a09;
    --term-fg: #efebe2;
    --term-muted: #948e83;
    --term-line: #2a2926;
    --term-accent: #ff7a2e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1a1a18;
  --text: #edeae3;
  --muted: #a39d92;
  --line: #2a2926;
  --line-strong: #3d3b36;
  --accent: #ff6b1a;
  --accent-text: #ff8a3d;
  --on-accent: #121211;
  --opt-bg: #1a1a18;
  --opt-hover: #232220;
  --label-bg: #1f1e1c;
  --code-bg: #262522;
  --term-bg: #0a0a09;
  --term-fg: #efebe2;
  --term-muted: #948e83;
  --term-line: #2a2926;
  --term-accent: #ff7a2e;
  color-scheme: dark;
}

.wide { --max: 72rem; }

/* ---------- page scaffolding ---------- */

.page { padding-top: clamp(1.5rem, 4vw, 3rem); }
.crumbs { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 1rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.crumbs li + li::before { content: "/"; margin-inline-end: 0.35rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

.page-head { margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem); font-weight: 800; letter-spacing: -0.015em; }
.page-head h1 .en { direction: ltr; unicode-bidi: isolate; }
.page-head .lede { color: var(--muted); font-size: 1.1rem; max-width: 46ch; margin-top: 0.6rem; }

.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 1rem 0 0; padding: 0; font-size: var(--fs-xs); }
.pills li {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  color: var(--muted);
}
.pills li b { color: var(--text); font-weight: 600; }
.badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: 999px;
  padding: 0 0.6rem;
  border: 1px solid var(--accent);
  color: var(--accent-text);
  vertical-align: middle;
}

.section { margin-top: 3rem; }
.section > h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 1rem; }
.section > .sub { color: var(--muted); font-size: var(--fs-s); margin-top: -0.6rem; margin-bottom: 1rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

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

.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) 2.25rem; text-align: center; }
.hero .eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.8rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
}
.hero h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.3;
  max-width: 22ch;
  margin-inline: auto;
}
.hero h1 .code { font-family: var(--mono); font-weight: 700; color: var(--accent-text); font-size: 0.85em; direction: ltr; unicode-bidi: isolate; }
.hero p { color: var(--muted); max-width: 40ch; margin: 1rem auto 0; font-size: 1.125rem; }

/* ---------- picker (home + product) ---------- */

.pick {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.pick fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.prow { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); }
@media (min-width: 40rem) {
  .prow { grid-template-columns: 7.5rem 1fr; }
}
.plabel { padding: 0.85rem 1rem 0.25rem; font-size: var(--fs-s); font-weight: 700; }
@media (min-width: 40rem) {
  .plabel { background: var(--label-bg); padding: 1rem; border-inline-end: 1px solid var(--line); }
}
.popts { padding: 0.75rem 1rem 1rem; display: grid; gap: 0.4rem; }
.popts.distros { grid-template-columns: repeat(auto-fit, minmax(6.75rem, 1fr)); }
.popts.products { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
.popts.tracks { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }

.opt { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--opt-bg);
  cursor: pointer;
  font-size: var(--fs-s);
  line-height: 1.35;
  text-align: center;
  transition: background-color 120ms, border-color 120ms;
}
.chip b { font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.chip small { color: var(--muted); font-size: 0.72rem; font-family: var(--mono); direction: ltr; }
.chip:hover { background: var(--opt-hover); border-color: var(--line-strong); }
.opt:checked + .chip { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt:checked + .chip small { color: var(--on-accent); opacity: 0.75; }
.opt:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }

.pver { padding: 0.8rem 1rem; font-size: var(--fs-s); color: var(--muted); }
.pver .v { font-family: var(--mono); color: var(--text); font-weight: 700; }
.pver a { margin-inline-start: 0.75rem; }
.prun { padding: 1rem; }

/* ---------- status line (home) ---------- */

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin-top: 2.5rem;
  font-size: var(--fs-s);
  color: var(--muted);
}
.status b { color: var(--text); font-weight: 600; }
.dot::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text); margin-inline-end: 0.4rem; vertical-align: 0.05em; }
.dot.is-stale::before { background: var(--accent); }
.dot.is-stale { color: var(--accent-text); font-weight: 600; }

/* ---------- tables ---------- */

.tbl-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: start; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--opt-hover); }
.tbl th[scope="row"] { font-weight: 600; white-space: nowrap; }
.tbl .en { direction: ltr; unicode-bidi: isolate; }
.tbl .v { font-family: var(--mono); font-size: 0.92em; }
.tbl .small { display: block; font-size: var(--fs-xs); color: var(--muted); }
.tbl .na, .tbl .none { color: var(--muted); }
.tbl .na .ltr { border: 1px dashed var(--line-strong); border-radius: 4px; padding: 0 0.3rem; }
.tbl a { text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.tbl-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 0.6rem; }

/* ---------- key/value ---------- */

.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-s); }
.kv dd { margin: 0; min-width: 0; }
.fingerprint {
  font-family: var(--mono);
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-spacing: 0.25em;
}

/* ---------- prose (Markdown) ---------- */

.prose { max-width: 44rem; }
.prose h2 { font-size: 1.3rem; font-weight: 800; margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.08rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.3rem; }
.prose code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.86em;
  direction: ltr;
  unicode-bidi: isolate;
}
.prose pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.prose .term { margin: 0.5rem 0 1.25rem; }
.term-doc pre { padding: 0.6rem 0.9rem 0.7rem; }
.prose .run { margin: 0.75rem 0 1.5rem; }
.prose blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-s);
}
.prose blockquote p:last-child { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); margin: 0.5rem 0 1.25rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: start; }
.prose th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.ln.plain::before { content: none; }
.ln.plain { padding-left: 0; text-indent: 0; }

.callout {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-s);
  padding: 0.8rem 1rem;
  font-size: var(--fs-s);
  margin: 1rem 0;
}
.callout p:last-child { margin: 0; }

/* ---------- lists of links ---------- */

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.rows a { display: block; padding: 0.9rem 0.25rem; color: var(--text); text-decoration: none; }
.rows a:hover .t { color: var(--accent-text); }
.rows .t { font-weight: 700; display: block; }
.rows .d { color: var(--muted); font-size: var(--fs-s); display: block; }
.rows .m { color: var(--muted); font-size: var(--fs-xs); display: block; margin-top: 0.2rem; }

.grid-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0 2rem;
  border-top: 1px solid var(--line);
}
.grid-links li { border-bottom: 1px solid var(--line); }
.grid-links a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.2rem; color: var(--text); text-decoration: none; }
.grid-links a:hover .n { color: var(--accent-text); }
.grid-links .n { font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.grid-links .v { font-family: var(--mono); font-size: var(--fs-s); color: var(--muted); direction: ltr; }

/* ---------- changes ---------- */

.change-set { margin-bottom: 2.25rem; }
.change-set h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.change-set h2 small { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); margin-inline-start: 0.5rem; }
.change-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); font-size: var(--fs-s); }
.change-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.change-list .k { display: inline-block; min-width: 6rem; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- search ---------- */

.search-box input {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.search-box input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-results { margin-top: 1.25rem; }
.search-empty { color: var(--muted); }

/* ---------- package lists ---------- */

.pkgs { border-bottom: 1px solid var(--line); }
.pkgs summary { cursor: pointer; padding: 0.7rem 0.2rem; font-size: var(--fs-s); }
.pkgs[open] summary { color: var(--accent-text); }
.pkgs .tbl-wrap { margin-bottom: 0.9rem; }
.pkgs p { font-size: var(--fs-s); color: var(--muted); }

/* ---------- 404 ---------- */

.lost { text-align: center; padding-block: 4rem 2rem; }
.lost .code { font-family: var(--mono); font-size: 3.5rem; font-weight: 700; color: var(--accent-text); direction: ltr; margin: 0; }

.chip.is-off { opacity: 0.45; }

.chip small.fa { font-family: var(--sans); direction: rtl; font-size: 0.72rem; }
.term-doc pre {
  margin: 0;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  font-size: var(--fs-s);
  line-height: 1.7;
}
@media (min-width: 40rem) {
  .prose :not(pre) > code { white-space: nowrap; }
}

.section-gap { margin-top: 1.5rem; }
.home-links { margin-top: 4rem; }
.home-links h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.75rem; }
.page-head h1 .en + .en { margin-inline-start: 0; }
