/* totalcmd.net / wincmd.ru — shared design, light & dark */
:root {
  --bg: #f7f8fb; --surface: #fff; --surface-2: #eef1f7; --text: #0f172a; --muted: #5b6477; --line: #e2e6ef;
  --accent: #2563eb; --accent-2: #0ea5e9; --accent-ink: #fff; --accent-soft: #e0eaff;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.05); --radius: 14px;
  --c-lister: #7c3aed; --c-packer: #d97706; --c-fsplugin: #059669; --c-content: #db2777;
}
[data-site="ru"] { --accent: #0f766e; --accent-2: #14b8a6; --accent-soft: #d5f3ef; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --surface: #121a2e; --surface-2: #17213a; --text: #e6ebf5; --muted: #97a3ba; --line: #243152;
    --accent: #5b8cff; --accent-2: #38bdf8; --accent-ink: #0b1020; --accent-soft: #1b2a52;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
    --c-lister: #a78bfa; --c-packer: #fbbf24; --c-fsplugin: #34d399; --c-content: #f472b6;
  }
  [data-site="ru"] { --accent: #2dd4bf; --accent-2: #5eead4; --accent-soft: #123a3a; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 62ch; }
.sr, .skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .topbar { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); } }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.brand-mark { display: inline-flex; gap: 3px; padding: 5px; background: var(--accent); border-radius: 8px; }
.brand-mark i { width: 8px; height: 16px; background: #fff; border-radius: 2px; }
.brand-mark i + i { opacity: .6; }
.topsearch { flex: 1; max-width: 420px; }
.topsearch input, .bigsearch input, .filters input[type=search], .filters select, .form input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
.topsearch input:focus, .bigsearch input:focus, .filters input:focus, .filters select:focus, .form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--muted); padding: 8px 11px; border-radius: 8px; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.lang-switch a { color: var(--muted); padding: 6px 4px; border-radius: 6px; }
.lang-switch a:hover { color: var(--accent); text-decoration: none; }
.lang-switch .current { color: var(--accent); padding: 6px 4px; }
.lang-switch .sep { color: var(--line); font-weight: 400; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-block { display: flex; width: 100%; justify-content: space-between; }
.btn small { font-weight: 500; opacity: .8; }

/* Hero */
.hero { padding: 64px 0 48px; background: radial-gradient(900px 380px at 85% -10%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%), radial-gradient(700px 360px at 0 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.bigsearch { display: flex; gap: 10px; max-width: 640px; margin: 24px 0 32px; }
.bigsearch input { padding: 13px 16px; font-size: 1.05rem; }
.center .bigsearch { margin-left: auto; margin-right: auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 860px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stats b { display: block; font-size: 1.55rem; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .88rem; }

/* Sections */
.section { padding: 48px 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.subhead { margin-top: 28px; color: var(--muted); font-size: 1rem; }
.page-head { padding: 40px 0 8px; }
.crumbs { padding-top: 20px; color: var(--muted); font-size: .92rem; }

.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: var(--radius); padding: 18px; color: var(--text); }
.type:hover { text-decoration: none; box-shadow: var(--shadow); }
.type small { color: var(--muted); }
.type-ext { font: 700 .78rem ui-monospace, Consolas, monospace; color: var(--c); }
.type-count { margin-top: auto; padding-top: 8px; font-size: .88rem; color: var(--c); font-weight: 600; }
.tag-lister { --c: var(--c-lister); } .tag-packer { --c: var(--c-packer); } .tag-fsplugin { --c: var(--c-fsplugin); } .tag-content { --c: var(--c-content); }
.section-tight { padding-top: 0; }
.purposes { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.purpose { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.purpose:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.purpose-icon { font-size: 1.5rem; line-height: 1; width: 2rem; text-align: center; }
.purpose-text { display: flex; flex-direction: column; min-width: 0; }
.purpose-text b { font-size: .95rem; line-height: 1.25; }
.purpose-text small { color: var(--muted); font-size: .8rem; }
.tag-topic { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.tag-topic:hover { text-decoration: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--text); font-size: .92rem; }
.chip span { color: var(--muted); margin-left: 4px; }
.chip:hover { border-color: var(--accent); text-decoration: none; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.thumb-label { display: none; }
.card-thumb.noimg { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.card-thumb.noimg .thumb-label { display: block; font: 800 1.3rem ui-monospace, Consolas, monospace; color: var(--accent); opacity: .7; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 12px; min-width: 0; }
.card-title { margin-bottom: 6px; }
.card-title a { color: var(--text); }
.ver { font-size: .82em; font-weight: 500; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.tag-lister, .tag.tag-packer, .tag.tag-fsplugin, .tag.tag-content { color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.tag-x64 { color: var(--accent); background: var(--accent-soft); }
.card-desc { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.card-foot { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); }

.toplist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.toplist li { display: grid; grid-template-columns: 2rem 1fr auto; grid-template-rows: auto auto; column-gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.toplist .rank { grid-row: span 2; font-weight: 800; color: var(--accent); font-size: 1.2rem; align-self: center; }
.toplist small { color: var(--muted); grid-column: 2; }
.toplist .dl { grid-row: 1 / span 2; grid-column: 3; align-self: center; color: var(--muted); font-size: .9rem; }

/* Catalog */
.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 28px; padding-bottom: 56px; align-items: start; }
.filters { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); font-weight: 500; }
.filters .f-check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.f-actions { display: flex; gap: 8px; }
.f-actions .btn { flex: 1; padding: 9px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 600; }
.pager a { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent); color: var(--accent-ink); }
.pager .disabled, .pager .gap { color: var(--muted); opacity: .6; }

/* Plugin page */
.plugin-page { display: grid; grid-template-columns: 1fr 300px; gap: 32px; padding-top: 12px; padding-bottom: 32px; align-items: start; }
.plugin-head h1 { margin-bottom: 10px; }
.shot { margin: 8px 0 24px; }
.shot img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 520px; width: auto; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 1.2rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose pre, .prose code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.prose pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.review { background: var(--accent-soft); border-radius: 12px; padding: 4px 18px 8px; margin-top: 20px; }
.whatsnew summary { cursor: pointer; list-style: none; }
.whatsnew summary h2 { display: inline; }
.whatsnew summary::after { content: " ▾"; color: var(--muted); }
.whatsnew-body { max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: .94rem; }
.plugin-side { position: sticky; top: 78px; }
.panel { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.pkg-note { margin: -4px 0 4px; font-size: .82rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 4px; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.side-link { font-size: .92rem; }

/* Articles, FAQ, forms */
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.article-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; }
.article-list small { color: var(--muted); }
.article { max-width: 820px; padding-bottom: 48px; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin-top: 20px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.alert { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.alert p { margin: 0; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.alert a { color: inherit; text-decoration: underline; }
.alert:focus { outline: 3px solid #f87171; outline-offset: 2px; }

/* Contact form */
.contact-form { max-width: 560px; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; }
.form select, .form textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.form textarea { resize: vertical; min-height: 9em; line-height: 1.5; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form [aria-invalid="true"] { border-color: #dc2626; }
.req { color: #dc2626; }
.optional { font-weight: 400; color: var(--muted); font-size: .9em; }
.field-hint { margin: 0; font-size: .86rem; color: var(--muted); }
.field-error { margin: 0; font-size: .88rem; color: #dc2626; font-weight: 500; }
.privacy-note { margin: 0; font-size: .88rem; color: var(--muted); }
.small { font-size: .84rem; margin: 0; }
.contact-form .btn { align-self: flex-start; min-width: 180px; }
.contact-form .btn:disabled { opacity: .65; cursor: progress; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sent-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: #16a34a; }
@media (prefers-color-scheme: dark) {
  .alert { background: #3b1219; color: #fecaca; }
  .req, .field-error { color: #f87171; }
  .form [aria-invalid="true"] { border-color: #f87171; }
}

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 0; max-width: 60ch; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 980px) {
  .types { grid-template-columns: repeat(2, 1fr); }
  .catalog, .plugin-page { grid-template-columns: 1fr; }
  .filters, .plugin-side { position: static; }
  .filters { display: grid; grid-template-columns: repeat(2, 1fr); }
  .filters .f-search, .filters .f-actions { grid-column: 1 / -1; }
  .topsearch { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 8px; }
  .nav a { padding: 8px 7px; font-size: .9rem; }
  .brand { font-size: .95rem; }
  .hero { padding: 36px 0 32px; }
  .bigsearch { flex-direction: column; }
  .stats, .types, .toplist { grid-template-columns: 1fr 1fr; }
  .toplist { grid-template-columns: 1fr; }
  .grid, .grid-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
}
