:root {
  --blue: #1a6cff;
  --blue-dark: #0f54d4;
  --blue-soft: #e8f0ff;
  --ink: #1c2433;
  --muted: #5c6578;
  --line: rgba(28, 36, 51, 0.1);
  --ok: #0d7a4f;
  --top-h: 64px;
  --page-pad: clamp(20px, 5vw, 64px);
  --content: min(1280px, 100%);
  --readable: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #f3f7fc;
}

/* Never show focus rings on page shells — only on real controls */
main,
main:focus,
main:focus-visible,
main:focus-within,
.wrap,
.wrap:focus,
.wrap:focus-visible,
.wrap:focus-within,
.home,
.home:focus,
.home:focus-visible,
.hero-band,
.cats-band,
.page-shell {
  outline: none !important;
  box-shadow: none !important;
}

a {
  color: var(--blue-dark);
  text-underline-offset: 2px;
}

a:hover { color: var(--blue); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
}

.skip:focus {
  left: 8px;
  top: 8px;
  outline: 2px solid #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  min-height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px var(--page-pad);
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 0.95rem;
}

.brand-text strong { font-weight: 800; }
.brand-text span { color: var(--muted); font-size: 0.78rem; font-weight: 600; }

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.top-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
}

.top-links a:hover { color: var(--blue); }

.top-links .nav-cta {
  background: var(--blue);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 999px;
}

.top-links .nav-cta:hover { background: var(--blue-dark); }

.lang-wrap select {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235c6578' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: 10px;
  padding: 8px 28px 8px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}

.wrap {
  width: 100%;
  flex: 1;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.hero-band {
  width: 100%;
  margin: 0;
  padding: clamp(64px, 14vh, 140px) var(--page-pad) clamp(40px, 7vh, 72px);
  text-align: center;
  background:
    radial-gradient(ellipse 900px 480px at 50% 0%, rgba(26, 108, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #eaf3ff 0%, #f3f7fc 100%);
  border: 0;
}

.hero-band h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-band p {
  margin: 0 auto 28px;
  max-width: 42rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.search-box {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 18px 20px 18px 52px;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 600;
  box-shadow: 0 10px 32px rgba(26, 108, 255, 0.1);
  outline: none;
}

.search-box input:focus {
  border-color: rgba(26, 108, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(26, 108, 255, 0.12), 0 10px 32px rgba(26, 108, 255, 0.1);
}

.search-box .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  margin-top: 10px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(28, 36, 51, 0.08);
}

.search-results[hidden] { display: none; }

.search-hit {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}

.search-hit:last-child { border-bottom: 0; }
.search-hit:hover,
.search-hit:focus {
  background: var(--blue-soft);
  outline: none;
}

.search-hit strong { display: block; font-size: 0.98rem; }
.search-hit span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.search-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cats-band {
  width: 100%;
  margin: 0;
  padding: 8px var(--page-pad) clamp(48px, 8vh, 80px);
  background: #f3f7fc;
  border: 0;
}

.cats {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
}

.cat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px;
  min-height: 128px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(26, 108, 255, 0.35);
  box-shadow: 0 10px 24px rgba(26, 108, 255, 0.1);
}

.cat-card h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 800;
}

.cat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.page-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px var(--page-pad) 64px;
  border: 0;
  background: transparent;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.crumbs a { text-decoration: none; font-weight: 700; }

.page-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 42rem;
}

.article-list { display: grid; gap: 10px; }

.article-row {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.article-row:hover {
  border-color: rgba(26, 108, 255, 0.35);
}

.article-row h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.article-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.article {
  width: 100%;
  max-width: var(--readable);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 28px 12px;
}

.article h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 800;
}

.article .summary {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.article .body {
  line-height: 1.65;
  font-size: 1.02rem;
}

.article .body h2,
.article .body h3 {
  margin-top: 1.4em;
  font-weight: 800;
}

.article .body p,
.article .body ul,
.article .body ol,
.article .body table {
  margin: 0 0 1em;
}

.article .body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article .body th,
.article .body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.article .body th { background: var(--blue-soft); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 8px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-dark);
  background: var(--blue-soft);
  padding: 4px 8px;
  border-radius: 999px;
}

.notice {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6e0;
  color: #6b4a00;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: var(--readable);
}

.form-card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.form-grid { display: grid; gap: 12px; }

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 600;
  background: #fff;
  outline: none;
}

.form-grid textarea { min-height: 140px; resize: vertical; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
}

.btn:hover { background: var(--blue-dark); }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.form-hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.form-ok {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e8f7ef;
  color: var(--ok);
  font-weight: 700;
}

.contact-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  padding: 22px var(--page-pad) 32px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: auto;
}

.footer a { text-decoration: none; color: var(--ink); }
.footer a:hover { color: var(--blue); }
.footer span { color: var(--muted); font-weight: 600; }

.empty {
  color: var(--muted);
  padding: 20px 0;
}

@media (max-width: 1100px) {
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .top-links { width: 100%; order: 3; }
  .lang-wrap { margin-left: auto; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article { padding: 20px 16px 10px; }
}

@media (max-width: 560px) {
  .cats { grid-template-columns: 1fr; }
}
