:root {
  --bg: #f6f4f1;
  --surface: #fffdfa;
  --surface-alt: #efe6dc;
  --text: #482813;
  --muted: #6f543d;
  --accent: #ac865d;
  --accent-dark: #8f6b45;
  --accent-soft: #d6bea5;
  --line: #e4dfd9;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(72, 40, 19, 0.14);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  font-family: "Montserrat", "Arial", sans-serif;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(172, 134, 93, 0.18) 0, transparent 34%),
    radial-gradient(circle at 92% 6%, rgba(214, 190, 165, 0.22) 0, transparent 36%),
    linear-gradient(180deg, #faf7f4 0%, var(--bg) 60%, #efe7de 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(246, 244, 241, 0.86), rgba(246, 244, 241, 0.94));
  opacity: 1;
}

main,
footer {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

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

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 241, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
}

.brand small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-width: 92px;
  height: 40px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #c09b73 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(72, 40, 19, 0.28);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark) 0%, #996f45 100%);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.hero {
  position: relative;
  overflow: hidden;
  background-color: #1e1109;
  padding: 60px 0 26px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/media/backgrounds/defakto-hero-bg.jpg");
  background-image: image-set(
    url("/assets/media/backgrounds/defakto-hero-bg.avif") type("image/avif"),
    url("/assets/media/backgrounds/defakto-hero-bg.webp") type("image/webp"),
    url("/assets/media/backgrounds/defakto-hero-bg.jpg") type("image/jpeg")
  );
  background-position: -120px 100%;
  background-size: calc(100% + 260px) auto;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(72, 40, 19, 0.42) 0%, rgba(72, 40, 19, 0.2) 42%, rgba(72, 40, 19, 0.08) 68%),
    linear-gradient(to bottom, rgba(72, 40, 19, 0.2) 0%, rgba(72, 40, 19, 0.08) 100%);
  z-index: 0;
}

.hero .container {
  width: min(100% - 32px, 1240px);
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding-left: 150px;
}

@media (max-width: 1400px) {
  .hero::before {
    background-position: -80px 100%;
    background-size: calc(100% + 180px) auto;
  }

  .hero-grid {
    padding-left: 90px;
  }
}

@media (max-width: 1250px) {
  .hero-grid {
    padding-left: 40px;
  }
}

@media (max-width: 1100px) {
  .hero::before {
    background-size: cover;
    background-position: center center;
  }

  .hero-grid {
    padding-left: 0;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  background: linear-gradient(
    130deg,
    rgba(255, 253, 250, 0.9) 12%,
    rgba(242, 234, 225, 0.84) 90%
  );
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9e2da;
  font-size: 12px;
  font-weight: 700;
  color: #482813;
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 48px);
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(24px, 3.8vw, 34px);
  margin-bottom: 16px;
}

h3 {
  font-size: 21px;
  margin-bottom: 12px;
}

p {
  margin: 0 0 14px;
}

ul {
  margin: 0;
  padding-left: 20px;
}

.hero-list {
  color: var(--muted);
  margin-bottom: 26px;
}

.hero-copy .btn {
  margin: 6px 8px 0 0;
}

.hero-form {
  padding: 26px;
  background: linear-gradient(180deg, #fffdfa, #f2ebe2);
}

.form-title {
  margin-bottom: 14px;
  font-size: 22px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: inherit;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: #ac865d;
  box-shadow: 0 0 0 4px rgba(172, 134, 93, 0.2);
}

textarea {
  min-height: 94px;
  resize: vertical;
}

.form-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.form-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-note a:hover {
  color: var(--accent-dark);
}

.form-note.is-error {
  color: #b3462f;
}

.policy-pre {
  margin: 0;
  font: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
}

.metrics {
  padding: 0 0 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

section {
  padding: 36px 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

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

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

.grid-2 > .card,
.grid-3 > .card {
  height: 100%;
}

.feature,
.service,
.faq-item,
.city-item,
.step,
.tariff {
  padding: 22px;
}

.lawyer-photo-card {
  padding: 0;
  overflow: hidden;
}

.lawyer-photo-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

.lawyer-photo {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center 28%;
}

.lawyer-intro h2 {
  margin-bottom: 10px;
}

.lawyer-intro-main {
  display: flex;
  flex-direction: column;
}

.lawyer-intro-main .diploma-grid {
  margin-top: auto;
}

.lawyer-intro-main .diploma-caption {
  margin-bottom: 14px;
}

.lawyer-intro-main > .btn {
  align-self: flex-start;
}

.diploma-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.diploma-thumb {
  height: 220px;
  margin-bottom: 0;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}

.diploma-caption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.list-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.list-links a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  font-weight: 600;
}

.page-head {
  padding: 54px 0 20px;
}

.page-head + section {
  padding-top: 24px;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.cta-box {
  padding: 28px;
  background: linear-gradient(130deg, #fffdfa, #f1e9df 75%);
}

.problem-box {
  padding: 24px;
  border-left: 4px solid var(--accent);
}

.review-grid,
.practice-grid {
  display: grid;
  gap: 16px;
}

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

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

.review-item,
.practice-item {
  padding: 24px;
}

.review-case {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
  align-items: start;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.review-name {
  font-weight: 700;
  font-size: 18px;
}

.practice-thumb {
  border-radius: 10px;
  border: 1px solid var(--line);
  height: 190px;
  object-fit: cover;
  width: 100%;
  margin-bottom: 10px;
}

.review-doc .practice-thumb {
  height: 140px;
  margin-bottom: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.review-doc small {
  color: var(--muted);
  font-weight: 600;
}

.doc-trigger {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.doc-trigger::after {
  content: "Открыть документ";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: rgba(72, 40, 19, 0.52);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.doc-trigger:hover::after {
  opacity: 1;
}

.doc-trigger:focus-visible::after {
  opacity: 1;
}

.doc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(38, 24, 14, 0.58);
  backdrop-filter: blur(2px);
  z-index: 120;
}

.doc-modal.is-open {
  display: flex;
}

.doc-modal__panel {
  width: min(980px, 100%);
  max-height: min(88vh, 1100px);
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(38, 24, 14, 0.38);
  overflow: auto;
  position: relative;
}

.doc-modal__close {
  position: sticky;
  top: 10px;
  margin-left: auto;
  margin-right: 10px;
  margin-top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.doc-modal__image {
  width: 100%;
  height: auto;
  padding: 8px 14px 16px;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 24px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.table th,
.table td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.table tr:last-child td {
  border-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card > :last-child {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .hero-grid,
  .grid-3,
  .grid-2,
  .list-links,
  .metrics-grid,
  .practice-grid {
    grid-template-columns: 1fr;
  }

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

  .review-case {
    grid-template-columns: 1fr;
  }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav,
  .header-actions,
  .header-inner > .btn-secondary {
    display: none;
  }

  .site-header.menu-open .nav {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    padding-top: 6px;
  }

  .site-header.menu-open .header-actions,
  .site-header.menu-open .header-inner > .btn-secondary {
    display: flex;
    grid-column: 1 / -1;
  }

  .site-header.menu-open .header-actions {
    flex-wrap: wrap;
  }

  .site-header.menu-open .header-inner > .btn-secondary {
    width: fit-content;
  }

  .hero-copy {
    padding: 26px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 680px;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  section {
    padding: 34px 0;
  }

  .hero {
    padding-top: 44px;
  }

  .hero::before {
    background-position: left center;
    background-size: cover;
  }

  .hero::after {
    background:
      linear-gradient(to right, rgba(72, 40, 19, 0.78) 0%, rgba(72, 40, 19, 0.52) 55%, rgba(72, 40, 19, 0.2) 100%),
      linear-gradient(to bottom, rgba(72, 40, 19, 0.38) 0%, rgba(72, 40, 19, 0.16) 100%);
  }

  .hero-copy,
  .hero-form,
  .cta-box,
  .review-item,
  .practice-item {
    padding: 20px;
  }

  .lawyer-photo {
    min-height: 360px;
    object-position: center 22%;
  }

  .diploma-thumb {
    height: 180px;
  }

  .doc-modal {
    padding: 12px;
  }

  .practice-thumb {
    height: 170px;
  }

  .review-doc .practice-thumb {
    height: 124px;
  }
}

@media (max-width: 560px) {
  .review-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .hero-copy .btn {
    margin-right: 0;
  }

  .table {
    min-width: 560px;
  }

  .doc-modal__panel {
    border-radius: 10px;
  }

  .lawyer-photo {
    min-height: 320px;
  }

  .diploma-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .doc-trigger::after {
    opacity: 1;
    align-items: flex-end;
    justify-content: center;
    padding: 0 10px 10px;
    background: linear-gradient(180deg, rgba(72, 40, 19, 0.05) 30%, rgba(72, 40, 19, 0.72) 100%);
    font-size: 13px;
    content: "Нажмите для увеличения";
  }
}
