/* AvtoZap — one column grid */
:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #e2e2de;
  --tg: #229ed9;
  --tg-hover: #1b8fc4;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 800px;
  --gutter: 1.25rem;
  --header-h: 56px;
  --space: 1.5rem;
  --space-lg: 2rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--tg);
}

a:hover {
  color: var(--tg-hover);
}

/* Single alignment rail for the whole site */
.shell {
  width: min(100% - (var(--gutter) * 2), var(--page));
  margin-inline: auto;
}

.wrap,
.wrap-wide,
.header-inner,
.footer-grid {
  width: min(100% - (var(--gutter) * 2), var(--page));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 247, 245, 0.96);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 0.75rem;
  min-height: var(--header-h);
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.nav {
  display: none;
  align-items: center;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  overflow: hidden;
}

.lang-switch a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.3rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.lang-switch a.is-active {
  color: #fff;
  background: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}

.btn-tg {
  background: var(--tg);
  color: #fff !important;
}

.btn-tg:hover {
  background: var(--tg-hover);
  color: #fff !important;
}

.btn-ghost {
  background: var(--panel);
  color: var(--ink) !important;
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: #c8c8c4;
  color: var(--ink) !important;
}

.header-cta {
  display: none;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1.1rem;
  padding: 0;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.mobile-nav a:last-child {
  border-bottom: 0;
}

/* Landing */
.hero {
  padding: var(--space-lg) 0 var(--space);
}

.hero-name {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.hero-actions .btn {
  width: 100%;
}

.hero-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.section {
  padding: var(--space) 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0;
}

.steps li {
  position: relative;
  display: grid;
  align-items: start;
  padding: 0.75rem 0 0.75rem 2.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  counter-increment: step;
}

.steps li:last-child {
  border-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.why-text {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.why-text p {
  margin: 0;
  color: var(--muted);
}

.template-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-wrap;
  font-family: ui-monospace, "IBM Plex Mono", Menlo, Consolas, monospace;
}

.section .btn-tg {
  margin-top: 1rem;
}

/* SEO link blocks — equal columns */
.seo-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.seo-group-title {
  margin: 1.25rem 0 0.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.seo-group-title:first-of-type {
  margin-top: 0.25rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-grid li {
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.link-grid a {
  display: block;
  padding: 0.65rem 0.5rem 0.65rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-grid a:hover {
  color: var(--tg);
}

/* Inner pages */
.page-hero {
  padding: var(--space) 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--tg);
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.page-hero .lead {
  margin: 0;
  color: var(--muted);
}

.prose {
  padding: var(--space) 0 0.5rem;
  display: grid;
  gap: 0.85rem;
}

.prose p {
  margin: 0;
  color: var(--muted);
}

.prose p:first-of-type {
  color: var(--ink);
}

.content-cta {
  margin: var(--space) 0;
  padding: 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
}

.content-cta h2 {
  margin: 0;
  font-size: 1.08rem;
}

.content-cta > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.content-cta .btn {
  justify-self: start;
}

.content-cta .hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.content-cta .template-box {
  margin-top: 0;
}

.faq {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.faq-item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.related-strip {
  padding: 0 0 2.5rem;
}

.related-strip h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.related-strip ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.related-strip li {
  border-bottom: 1px solid var(--line);
}

.related-strip a {
  display: block;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.related-strip a:hover {
  color: var(--tg);
}

/* Footer — same rail */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-lg) 0 5.5rem;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  gap: var(--space);
}

.footer-brand {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.footer-grid > div > p {
  margin: 0 0 0.65rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1.25rem;
}

.footer-cols a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.footer-cols a:hover {
  color: var(--tg);
}

.footer-meta {
  margin: 0.75rem 0 0 !important;
  font-size: 0.8rem;
}

.sticky-tg {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: auto;
  max-width: var(--page);
  margin-inline: auto;
}

.sticky-tg .btn {
  width: 100%;
  min-height: 48px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@media (min-width: 720px) {
  .hero-actions {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  .hero-actions .btn {
    width: auto;
    min-width: 11rem;
  }

  .link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 880px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .nav {
    display: flex;
    justify-content: center;
  }

  .header-cta {
    display: inline-flex;
  }

  .menu-toggle {
    display: none;
  }

  .sticky-tg {
    display: none;
  }

  body {
    padding-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 2rem;
  }

  .hero {
    padding: 2.75rem 0 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
