/* MH Files — сайт. Палитра и шрифт — из crates/ui/src/theme.rs, чтобы сайт выглядел как
   сама программа: тёмное окно, Cuprum, акцент #3FD0D8. */

@font-face {
  font-family: "Cuprum";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../assets/fonts/cuprum-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Cuprum";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../assets/fonts/cuprum-bold.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #0b0b0d;          /* BACKGROUND */
  --window: #0e1116;      /* WINDOW_BACKGROUND */
  --panel: #12161d;       /* PANEL */
  --card: #151a22;        /* CARD */
  --stroke: #242c38;      /* CARD_STROKE */
  --field: #0f1319;       /* FIELD */
  --text: #f1f1f1;        /* TEXT_PRIMARY */
  --text-2: #a9a9ad;      /* TEXT_SECONDARY */
  --text-3: #85858d;      /* светлее TEXT_DISABLED: мелкий текст должен читаться (4.5:1) */
  --accent: #3fd0d8;
  --accent-dim: #2b7c84;  /* 55 % акцента, как задняя стенка значка */
  --accent-fill: rgba(63, 208, 216, 0.14);
  --accent-line: rgba(63, 208, 216, 0.55);
  --warn: #f2a33c;
  --critical: #e85c5c;

  --font: "Cuprum", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;

  --page: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
  --radius-window: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7fe3e8; }
button, input { font: inherit; color: inherit; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: rgba(63, 208, 216, 0.2); }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--field); border: 1px solid var(--stroke); border-radius: 4px; padding: 0.05em 0.35em; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(63, 208, 216, 0.35); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 20;
  padding: 8px 14px; background: var(--accent); color: var(--bg); border-radius: var(--radius); font-weight: 700;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------ шапка */

.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand:hover { color: var(--text); }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--text-2); text-decoration: none; }
.nav a:hover { color: var(--text); }
.lang { color: var(--text-2); text-decoration: none; border: 1px solid var(--stroke); border-radius: var(--radius); padding: 3px 10px; font-size: 0.95rem; }
.lang:hover { color: var(--text); border-color: var(--text-3); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* ---------------------------------------------------------- кнопки */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 10px 20px;
  border-radius: var(--radius); border: 1px solid var(--stroke);
  background: var(--card); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { color: var(--text); border-color: var(--text-3); background: #1a202a; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #061214; }
.btn--primary:hover { background: #6fdee4; border-color: #6fdee4; color: #061214; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn small { font-weight: 400; opacity: 0.75; font-size: 0.9rem; }

/* ------------------------------------------------------------- hero */

.hero { padding: clamp(40px, 8vw, 88px) 0 clamp(48px, 7vw, 80px); }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 13em;
  text-wrap: balance;
}
.hero .lead { margin-top: 22px; max-width: 40em; color: var(--text-2); font-size: clamp(1.15rem, 2vw, 1.3rem); text-wrap: pretty; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero .fine { margin-top: 14px; color: var(--text-3); font-size: 0.98rem; }

/* Демо: окно программы с полем поиска по дискам. Главный элемент страницы. */

.demo { margin-top: clamp(40px, 6vw, 64px); }
.window {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-window);
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.titlebar {
  display: grid; grid-template-columns: 1fr minmax(0, 470px) 1fr; align-items: center; gap: 12px;
  height: 48px; padding: 0 0 0 14px;
  background: var(--window); border-bottom: 1px solid var(--stroke);
}
.titlebar .app { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; white-space: nowrap; }
.titlebar .app svg { width: 18px; height: 18px; }
.titlebar .controls { justify-self: end; display: flex; height: 100%; }
.titlebar .controls span { width: 46px; display: grid; place-items: center; color: var(--text-2); }
.titlebar .controls svg { width: 12px; height: 12px; }

.searchbox {
  position: relative; display: flex; align-items: center;
  height: 32px; background: var(--field); border: 1px solid var(--stroke); border-radius: var(--radius);
}
.searchbox:focus-within { border-color: var(--accent); }
.searchbox > svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-2); pointer-events: none; }
.searchbox input {
  width: 100%; height: 100%; min-width: 0;
  padding: 0 64px 0 32px; border: 0; background: transparent; outline: none;
  font-family: var(--mono); font-size: 0.92rem;
}
.searchbox input:disabled { opacity: 1; }
.searchbox input::placeholder { color: var(--text-3); }
@media (hover: none) { .searchbox kbd { display: none; } .searchbox input { padding-right: 10px; } }
.searchbox kbd { position: absolute; right: 9px; font-size: 0.75rem; color: var(--text-3); font-family: var(--font); }
.is-error .searchbox { border-color: var(--critical); }
.is-error [data-status] { color: var(--critical); }

.results { min-height: 314px; background: var(--bg); }
.results .meta { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; padding: 10px 14px 6px; font-size: 0.95rem; color: var(--text-2); }
.results .meta [data-status] { color: var(--text); font-variant-numeric: tabular-nums; }
.results .meta [data-total] { color: var(--text-3); font-size: 0.88rem; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 0.97rem; }
.table th {
  text-align: left; font-weight: 400; color: var(--text-2); font-size: 0.92rem;
  padding: 6px 12px; border-bottom: 1px solid var(--stroke);
}
.table td { padding: 0 12px; height: 31px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table tbody tr:hover td { background: var(--panel); }
.table .c-name { width: 44%; }
.table .c-time { width: 18%; color: var(--text-2); }
.table .c-dir { width: 26%; color: var(--text-2); }
.table .c-size { width: 12%; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.table .c-name .ico { display: inline-block; vertical-align: -3px; width: 16px; height: 16px; margin-right: 9px; }
.table .c-name .sub { display: none; }
.results .note { padding: 8px 14px 14px; color: var(--text-3); font-size: 0.95rem; min-height: 1.5em; }

.ico--folder { color: var(--accent); }
.ico--doc { color: #6fa8f5; }
.ico--image { color: #3fd0a0; }
.ico--video { color: var(--warn); }
.ico--audio { color: #f0709a; }
.ico--archive { color: #c7b06a; }
.ico--code { color: var(--text-2); }
.ico--model { color: var(--accent); }
.ico--app { color: #8f8cf0; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.examples p { color: var(--text-2); margin-right: 4px; }
.chip {
  border: 1px solid var(--stroke); background: var(--panel); border-radius: var(--radius);
  padding: 4px 10px; min-height: 34px; cursor: pointer;
  font-family: var(--mono); font-size: 0.86rem; color: var(--text);
}
.chip:hover { border-color: var(--accent-line); }
.demo-note { margin-top: 12px; color: var(--text-3); font-size: 0.95rem; max-width: 60em; }

@media (max-width: 760px) {
  .titlebar { grid-template-columns: minmax(0, 1fr); padding: 8px; height: auto; }
  .titlebar .app, .titlebar .controls { display: none; }
  .table thead { display: none; }
  .table .c-time, .table .c-dir { display: none; }
  .table .c-name { width: 72%; }
  .table .c-size { width: 28%; }
  .table td { height: auto; padding-top: 6px; padding-bottom: 6px; }
  .table .c-name .sub { display: block; margin-left: 25px; color: var(--text-3); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; }
  .table .c-name .name { white-space: normal; }
  .results { min-height: 0; }
}

/* --------------------------------------------------------- разделы */

.section { padding: clamp(56px, 9vw, 104px) 0; border-top: 1px solid var(--stroke); }
.section-head { max-width: 46em; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.05; text-wrap: balance; }
.section-head p { margin-top: 14px; color: var(--text-2); font-size: 1.2rem; text-wrap: pretty; }

/* Тур по окну: вкладки слева, снимок справа. Без JS — все снимки подряд. */

.tour-tabs { display: flex; flex-direction: column; gap: 2px; }
.tour-tabs button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%; padding: 10px 14px; min-height: 44px;
  text-align: left; background: none; border: 0; border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2); cursor: pointer; font-size: 1.08rem;
}
.tour-tabs button:hover { color: var(--text); background: var(--panel); }
.tour-tabs button[aria-selected="true"] { color: var(--text); background: var(--panel); border-left-color: var(--accent); }
.tour-tabs kbd { font-family: var(--font); font-size: 0.85rem; color: var(--text-3); white-space: nowrap; }

.tour-panel + .tour-panel { margin-top: 64px; }
.tour.is-tabbed { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.tour.is-tabbed .tour-panel + .tour-panel { margin-top: 0; }
.tour-panel .shot { border: 1px solid var(--stroke); border-radius: var(--radius-window); overflow: hidden; background: var(--bg); }
.tour-panel .shot img { width: 100%; height: auto; }
.tour-panel h3 { font-size: 1.5rem; margin-top: 22px; }
.tour-panel ul { margin-top: 10px; display: grid; gap: 6px; max-width: 48em; }
.tour-panel li, .more li { position: relative; padding-left: 18px; color: var(--text-2); text-wrap: pretty; }
.tour-panel li::before, .more li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 7px; height: 2px; background: var(--accent-dim); }
.tour-panel li strong, .more li strong { color: var(--text); font-weight: 700; }

@media (max-width: 900px) {
  .tour.is-tabbed { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tour-tabs { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
  .tour-tabs button { width: auto; flex: none; border-left: 0; border-bottom: 3px solid transparent; border-radius: var(--radius) var(--radius) 0 0; }
  .tour-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); }
  .tour-tabs kbd { display: none; }
}

.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: clamp(56px, 7vw, 80px); }
.more h3 { font-size: 1.3rem; margin-bottom: 12px; }
.more ul { display: grid; gap: 8px; }
@media (max-width: 900px) { .more { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Скорость: таблица в виде списка файлов программы. */

.spec { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.spec th { text-align: left; font-weight: 400; color: var(--text-2); font-size: 0.95rem; padding: 8px 14px; border-bottom: 1px solid var(--stroke); }
.spec td { padding: 14px; border-bottom: 1px solid var(--panel); vertical-align: top; text-wrap: pretty; }
.spec td:first-child { color: var(--text); width: 26%; }
.spec td:nth-child(2) { color: var(--accent); font-weight: 700; width: 24%; font-variant-numeric: tabular-nums; }
.spec td:last-child { color: var(--text-2); }
.spec tbody tr:hover td { background: var(--panel); }
.spec-note { margin-top: 18px; color: var(--text-3); font-size: 0.98rem; max-width: 56em; }
@media (max-width: 760px) {
  .spec thead { display: none; }
  .spec tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
  .spec td { padding: 0; border: 0; width: auto !important; }
  .spec td:last-child { grid-column: 1 / -1; margin-top: 4px; font-size: 0.98rem; }
  .spec tbody tr:hover td { background: none; }
}

/* Клавиши */

.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.keys div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--panel); }
.keys dt { color: var(--text-2); }
.keys dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
kbd.key {
  display: inline-block; min-width: 1.9em; padding: 2px 7px; text-align: center;
  font-family: var(--font); font-size: 0.92rem; color: var(--text);
  background: var(--card); border: 1px solid var(--stroke); border-bottom-width: 2px; border-radius: 5px;
  white-space: nowrap;
}
.keys-note { margin-top: 18px; color: var(--text-3); font-size: 0.98rem; }
@media (max-width: 760px) { .keys { grid-template-columns: minmax(0, 1fr); } }

/* Скачать */

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.option { display: flex; flex-direction: column; gap: 12px; padding: 26px; border: 1px solid var(--stroke); border-radius: var(--radius-window); background: var(--window); }
.option--main { border-color: var(--accent-line); background: linear-gradient(var(--accent-fill), var(--accent-fill)), var(--window); }
.option h3 { font-size: 1.45rem; }
.option p { color: var(--text-2); text-wrap: pretty; }
.option .file { font-family: var(--mono); font-size: 0.86rem; color: var(--text-3); overflow-wrap: anywhere; }
.option .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 760px) { .options { grid-template-columns: minmax(0, 1fr); } }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.facts h3 { font-size: 1.15rem; margin-bottom: 8px; }
.facts p { color: var(--text-2); font-size: 1.02rem; text-wrap: pretty; }
.facts p + p { margin-top: 8px; }
@media (max-width: 900px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.cli { margin-top: 40px; }
.cli h3 { font-size: 1.15rem; margin-bottom: 10px; }
.code {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  background: var(--field); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 14px 16px;
}
.code pre { margin: 0; flex: 1; overflow-x: auto; font-family: var(--mono); font-size: 0.9rem; line-height: 1.6; color: var(--text); }
.code button { flex: none; background: var(--card); border: 1px solid var(--stroke); border-radius: 5px; padding: 3px 10px; font-size: 0.9rem; color: var(--text-2); cursor: pointer; min-height: 32px; }
.code button:hover { color: var(--text); border-color: var(--text-3); }
.cli p { margin-top: 10px; color: var(--text-2); font-size: 1rem; }

/* Вопросы */

.faq { max-width: 52em; }
.faq details { border-bottom: 1px solid var(--stroke); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 32px 16px 0; position: relative;
  font-size: 1.2rem; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg);
  transition: transform 0.15s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover::after { border-color: var(--accent); }
.faq details > div { padding: 0 0 20px; color: var(--text-2); display: grid; gap: 10px; text-wrap: pretty; }

/* Подвал */

.foot { border-top: 1px solid var(--stroke); padding: 40px 0 56px; color: var(--text-2); font-size: 1rem; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot h2 { font-size: 1rem; color: var(--text); margin-bottom: 10px; }
.foot ul { display: grid; gap: 6px; }
.foot a { color: var(--text-2); }
.foot a:hover { color: var(--text); }
.foot p + p { margin-top: 8px; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: minmax(0, 1fr); } }
