:root {
  --paper: #ffffff;
  --paper-2: #f6f5f4;
  --card: #ffffff;
  --ink: #161616;
  --muted: #6b6560;
  --line: #eceae7;
  --stamp: #c6452c;
  --stamp-dark: #9d3320;
  --blush: #fde8e2;
  --leaf: #1f6a45;
  --leaf-bg: #e7f3ec;
  --warn: #8a4b12;
  --warn-bg: #fff1df;
  --shadow: 0 18px 50px rgba(198, 69, 44, 0.08);
  --serif: Inter, "Noto Sans Arabic", "Manrope", sans-serif;
  --sans: Inter, "Noto Sans Arabic", "Manrope", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
html[lang="ru"] body { font-family: "Manrope", var(--sans); }
html[lang="ar"] body, html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] .brand { font-family: "Noto Sans Arabic", sans-serif; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin: 0 0 0.45em; }
h2 { font-size: 1.35rem; margin: 0 0 0.6em; }
p { margin: 0 0 0.8em; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--ink); color: white; padding: 0.5rem 0.8rem; z-index: 5;
}
.skip:focus { top: 0.6rem; }

.site-header {
  position: sticky; top: 0; z-index: 4;
  background: color-mix(in srgb, var(--paper) 88%, white);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 1.4rem; min-height: 4.2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.03em; }
.logo-mark { width: 1.4rem; height: 1.4rem; display: block; }
.top-nav { display: flex; gap: 1.15rem; font-size: 0.92rem; font-weight: 500; }
.top-nav a { text-decoration: none; }
.header-end { margin-inline-start: auto; display: flex; align-items: center; gap: 0.6rem; }
.header-search { width: 220px; height: 40px; border: 1px solid #e4e0db; border-radius: 10px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #8d877f; background: #fff; }
.header-search input { border: 0; outline: none; width: 100%; background: transparent; min-height: 0; padding: 0; }

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 0.45rem 0.9rem; min-height: 2.6rem; display: inline-flex; align-items: center;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu nav {
  position: absolute; inset-inline-end: 0; top: calc(100% + 0.4rem);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  min-width: 12rem; padding: 0.4rem; box-shadow: var(--shadow); display: grid;
}
.lang-menu a { text-decoration: none; padding: 0.45rem 0.7rem; border-radius: 10px; }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: var(--blush); }

.split-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; padding: 4.2rem 0 1.2rem; }
.split-copy h1 { font-size: clamp(2.6rem, 5vw, 4rem); line-height: 0.98; letter-spacing: -0.045em; margin: 0 0 0.7rem; }
.upload-card { border: 1.5px dashed #e7a090; border-radius: 28px; padding: 2.4rem 2rem 1.6rem; text-align: center; box-shadow: var(--shadow); }
.upload-card h2 { font-size: 1.35rem; margin: 0 0 0.3rem; }
.upload-card p { color: var(--muted); }
.file-glyph { width: 72px; height: 84px; margin: 0.4rem auto 1rem; position: relative; }
.file-glyph span { display: block; width: 58px; height: 74px; margin: 0 auto; background: #f4f4f4; border-radius: 6px; position: relative; }
.file-glyph span::before { content: ""; position: absolute; right: 0; top: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: #e4e4e4 #fff; }
.file-glyph b { position: absolute; left: 50%; top: 28px; transform: translateX(-50%); background: var(--stamp); color: #fff; font-size: 11px; letter-spacing: 0.04em; padding: 4px 7px; border-radius: 3px; }
.or { display: flex; align-items: center; gap: 12px; color: #b0aaa4; font-size: 13px; margin: 1.1rem 0; }
.or::before, .or::after { content: ""; height: 1px; background: #eee; flex: 1; }
.or span { flex: 0 0 auto; }
.upload-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 54px; border-radius: 999px; background: var(--stamp); color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 0.04em; }
.upload-btn.inline { width: auto; padding: 0 1.4rem; }
.fine { margin-top: 0.8rem; color: #9a948c; font-size: 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.checks li { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
.tick { width: 22px; height: 22px; border-radius: 50%; background: #e8f1ff; color: #1d6fe8; display: grid; place-items: center; flex: 0 0 auto; }
.section-title { text-align: center; font-size: 2rem; margin: 3.2rem 0 0.4rem; }
.group-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #7a756f; font-weight: 600; margin: 1.6rem 0 0.7rem; }
.guide-head { display: flex; align-items: end; justify-content: space-between; margin: 3.4rem 0 0.4rem; }
.guide-head h2 { font-size: 2rem; margin: 0; }
.guide-head a { color: var(--stamp); font-weight: 600; text-decoration: none; }
.guide-lead { color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.post-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-height: 190px; display: flex; flex-direction: column; text-decoration: none; }
.post-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; }
.kicker { margin: 0 0 0.4rem; color: var(--stamp); font-size: 12px; font-weight: 700; }
.when { margin-top: auto; padding-top: 0.8rem; color: var(--muted); font-size: 12px; }
.guide-article h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.hero { padding: 2.4rem 0 1rem; }
.eyebrow {
  display: inline-flex; margin: 0 0 0.8rem; color: var(--stamp); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.stats { display: flex; gap: 1.2rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.stats strong { display: block; font-family: var(--serif); font-size: 1.8rem; }
.stats span { color: var(--muted); font-size: 0.92rem; }

.search-row { margin: 0.4rem 0 1.4rem; }
.search input, .field input, .field select, .field textarea, .copy-row input, .result input {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 14px;
  padding: 0.85rem 1rem; min-height: 3rem;
}
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.tool-group { margin: 0 0 1.6rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.tool-card {
  display: flex; gap: 0.8rem; align-items: flex-start; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 0.9rem;
  min-height: 5.4rem;
}
.tool-card:hover { transform: translateY(-2px); border-color: #e4b2a8; }
.tool-card strong { display: block; font-size: 1.02rem; }
.tool-card small { display: block; color: var(--muted); line-height: 1.35; margin-top: 0.15rem; }
.tool-icon {
  flex: 0 0 auto; width: 2.7rem; height: 2.7rem; border-radius: 12px;
  display: grid; place-items: center; background: var(--blush); color: var(--stamp);
}
.tool-icon svg { width: 1.45rem; height: 1.45rem; }

.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1rem 0 1.4rem; }
.band article, .panel, .result, .prose {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
}
.band article { padding: 1rem 1.1rem; }
.band h2 { font-size: 1.25rem; }
.prose { padding: 1.3rem 1.3rem 0.6rem; margin: 1rem 0 2rem; }
.prose p { color: #3c352e; }

.tool-head { padding-top: 1.4rem; max-width: 40rem; }
.panel { padding: 1rem; margin: 0.6rem 0 1rem; box-shadow: var(--shadow); }
.notice {
  display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem; border-radius: 14px; margin-bottom: 0.7rem;
  background: var(--paper-2);
}
.notice strong { font-size: 0.95rem; }
.notice span, .hint { color: var(--muted); font-size: 0.92rem; }
.notice.public { background: var(--warn-bg); color: var(--warn); }
.notice.public span { color: var(--warn); }
.notice.private { background: var(--leaf-bg); }
.drop {
  border: 1.5px dashed #d9cbb8; border-radius: 16px; padding: 1.3rem 1rem; text-align: center; background: #fbf7f1;
}
.drop.is-over { border-color: var(--stamp); background: #fff4f0; }
.file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-btn { margin-top: 0.4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--stamp); color: white; text-decoration: none; border: 0; border-radius: 14px;
  min-height: 3rem; padding: 0.7rem 1rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--stamp-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: white; }
#submit-btn, #message-form .btn { width: 100%; margin-top: 0.8rem; }
.btn.is-busy { opacity: 0.75; }
.btn.is-busy::after {
  content: ""; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  border: 2px solid white; border-inline-end-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.options { display: grid; gap: 0.8rem; margin-top: 0.9rem; }
.field { display: grid; gap: 0.35rem; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.choice { position: relative; display: flex; }
.choice input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.choice span { border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.75rem; background: white; }
.choice input:checked + span { background: var(--ink); color: white; border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.2rem; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--stamp); }
.range-line { display: flex; align-items: center; gap: 0.7rem; }
.range-line input { flex: 1; accent-color: var(--stamp); }
.range-line output { min-width: 2rem; font-variant-numeric: tabular-nums; }
input[type="color"] { width: 4.2rem; height: 3rem; padding: 0.25rem; background: white; }
.file-list, .order-list { list-style: none; padding: 0; margin: 0.7rem 0 0; display: grid; gap: 0.45rem; }
.file-list li, .order-list li {
  display: flex; align-items: center; gap: 0.6rem; background: white; border: 1px solid var(--line);
  border-radius: 12px; padding: 0.35rem 0.45rem;
}
.file-list img, .order-list img { width: 2.6rem; height: 2.6rem; object-fit: cover; border-radius: 8px; }
.file-list span, .order-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  border: 0; background: var(--paper-2); border-radius: 8px; min-width: 2.2rem; min-height: 2.2rem; cursor: pointer;
}
.order-box { margin-top: 0.8rem; }
.cropper { margin-top: 0.9rem; }
.crop-frame { position: relative; display: inline-block; max-width: 100%; direction: ltr; overflow: hidden; line-height: 0; }
.crop-frame img { display: block; max-width: 100%; height: auto; }
.crop-box {
  position: absolute; border: 2px solid white; box-shadow: 0 0 0 999px rgba(34, 30, 26, 0.45);
  cursor: move; touch-action: none;
}
.crop-box::after {
  content: ""; position: absolute; width: 14px; height: 14px; right: 4px; bottom: 4px;
  background: white; border: 2px solid var(--ink); border-radius: 4px;
}
.form-error { color: var(--stamp-dark); font-weight: 600; }
.form-ok { color: var(--leaf); font-weight: 600; }
.result { padding: 1rem; margin-bottom: 1rem; }
.preview { display: block; margin: 0.6rem auto; border-radius: 16px; background: repeating-conic-gradient(#efe8dc 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.copy-row .btn { flex: 1; }
.result input { margin-bottom: 0.6rem; }
.steps { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.steps li { display: flex; gap: 0.7rem; align-items: flex-start; }
.steps span {
  flex: 0 0 auto; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: white; font-size: 0.85rem;
}
.faq details { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.related { margin-bottom: 2rem; }
.crumbs { display: flex; gap: 0.45rem; align-items: center; color: var(--muted); font-size: 0.92rem; padding-top: 1rem; flex-wrap: wrap; }
.crumbs a { color: var(--stamp-dark); }
.miss { padding: 3rem 0; }
.updated { color: var(--muted); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.hp input { width: 1px; height: 1px; }
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0 1rem; margin-top: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1.2rem; }
.site-footer nav { display: grid; align-content: start; gap: 0.35rem; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.rights { color: var(--muted); font-size: 0.9rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.empty-search { color: var(--muted); }

@media (max-width: 800px) {
  .band, .footer-grid, .split-hero, .post-grid { grid-template-columns: 1fr; }
  .copy-row { flex-direction: column; }
  .top-nav { display: none; }
  .header-search { width: 140px; }
  .split-copy h1 { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
