/* Automation Agency — Brand: #4E0D07, #000000. Dark industrial. */

:root {
  --primary: #4E0D07;
  --primary-hover: #6b1209;
  --secondary: #000000;
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-elevated: #161616;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --border: #262626;
  --accent-line: #4E0D07;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --container: min(1200px, 92vw);
  --radius: 2px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right, 0)) 0 max(1rem, env(safe-area-inset-left, 0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -7px;
}

.nav-toggle__bars::after {
  top: 7px;
}

.nav-toggle.is-active .nav-toggle__bars {
  background: transparent;
}

.nav-toggle.is-active .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo img {
  height: 52px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--text);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Hero */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 0%, transparent 50%, rgba(78, 13, 7, 0.03) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(78, 13, 7, 0.03) 2px, rgba(78, 13, 7, 0.03) 4px);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 18ch;
}

.hero .subheadline {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Section common */
.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right, 0)) 0 max(1rem, env(safe-area-inset-left, 0));
}

.container--wide {
  max-width: min(1100px, 82vw);
  padding: 0 2.5rem;
}

/* Stats / Social proof */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card .btn {
  margin-top: auto;
}

/* Process steps */
.process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.process-item {
  position: relative;
  padding-left: 3rem;
}

.process-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.process-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* CTA strip */
.cta-strip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.cta-strip h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.cta-strip p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Contact modal */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.contact-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.contact-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.case-modal__prose {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.case-modal__prose p {
  margin-bottom: 0.9rem;
}

.case-modal__prose ul {
  margin: 0.35rem 0 1rem 1.2rem;
  padding: 0;
}

.case-modal__prose li {
  margin-bottom: 0.45rem;
}

.case-modal__prose .case-prose__h {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.35rem 0 0.55rem;
  letter-spacing: -0.01em;
}

.case-modal__prose .case-modal__lead + .case-prose__h {
  margin-top: 1.15rem;
}

.case-modal__prose .case-modal__lead {
  color: var(--text);
}

.case-modal__prose .case-modal__result {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.case-modal__prose .case-modal__result-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.case-modal__prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.case-modal__prose a:hover {
  color: var(--primary-hover);
}

.cases-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .cases-grid {
    gap: 1.75rem;
  }
}

.case-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

.case-card__expand {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  background: transparent;
  overflow: visible;
}

.case-card__expand-trigger {
  list-style: none;
  cursor: pointer;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
}

.case-card__expand-trigger::-webkit-details-marker {
  display: none;
}

.case-card__expand-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: background var(--transition), border-color var(--transition);
}

.case-card__expand-trigger:hover .case-card__expand-inner {
  background: rgba(78, 13, 7, 0.14);
  border-color: #3f3f3f;
}

.case-card__expand[open] .case-card__expand-inner {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.case-card__expand-trigger:focus {
  outline: none;
}

.case-card__expand-trigger:focus-visible .case-card__expand-inner {
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary);
}

.case-card__expand-text--less {
  display: none;
}

.case-card__expand[open] .case-card__expand-text--more {
  display: none;
}

.case-card__expand[open] .case-card__expand-text--less {
  display: inline;
}

.case-card__expand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.55rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.case-card__expand-trigger:hover .case-card__expand-icon {
  border-color: var(--primary);
  background: rgba(78, 13, 7, 0.15);
}

.case-card__expand[open] .case-card__expand-icon {
  transform: rotate(180deg);
}

.case-card__expand-body {
  margin: 1rem 0 0;
  padding: 0 0 0.25rem 0;
  border: none;
  max-width: 65ch;
  background: transparent;
  animation: caseExpandIn 0.35s ease both;
}

.case-card__expand-body .case-modal__prose a {
  color: #e0c8c4;
  text-decoration: underline;
  text-decoration-color: rgba(78, 13, 7, 0.85);
  text-underline-offset: 2px;
}

.case-card__expand-body .case-modal__prose a:hover {
  color: #fff;
  text-decoration-color: var(--primary);
}

.case-card__expand-body .case-modal__result {
  border-top-color: rgba(255, 255, 255, 0.07);
}

@keyframes caseExpandIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-card__expand-body {
    animation: none;
  }

  .case-card__expand-icon {
    transition: none;
  }
}

.case-expand__cta {
  margin: 1.35rem 0 0;
  padding-top: 0;
  border: none;
}

.case-expand__cta-btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 480px) {
  .case-expand__cta-btn {
    width: auto;
  }
}

.contact-modal__close {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  right: max(0.5rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.contact-modal__close:hover {
  color: var(--text);
  background: var(--bg-card);
}

.contact-modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.contact-modal__hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.contact-modal__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.contact-modal__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact-modal__field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.contact-modal__field input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.contact-modal__field input:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  cursor: pointer;
}

.contact-modal__consent input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.contact-modal__consent a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-modal__consent a:hover {
  color: #fff;
}

.contact-modal__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.contact-modal__manual {
  width: 100%;
  margin-top: 0.75rem;
}

.contact-modal__messengers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-modal__messenger {
  width: 100%;
}

.contact-modal__back {
  width: 100%;
  margin-top: 1rem;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-hero .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Services list — карточки с отступами от краёв */
.services-list {
  padding: 3rem 0 5rem;
}

.service-cards {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.service-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  padding: 2.5rem 2.5rem 2.5rem 2rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 24px rgba(78, 13, 7, 0.15);
}

.service-card__icon {
  width: 56px;
  height: 56px;
  background: rgba(78, 13, 7, 0.2);
  color: var(--primary);
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.service-card__content {
  min-width: 0;
}

.service-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.service-card__desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.service-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.service-card__tags li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .container--wide {
    padding: 0 1.5rem;
    max-width: 100%;
  }
  .service-card {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }
  .service-card__icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

/* Video case cards */
#case-green-house,
#case-refinans,
#case-sneakers-wash {
  scroll-margin-top: 5.5rem;
}

.case-meta__hash {
  color: var(--text-muted);
  font-weight: 500;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--transition);
}

.case-card:hover {
  border-color: var(--primary);
}

.case-card .thumb {
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}

.case-card .thumb.thumb--video {
  padding: 0;
  display: block;
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.case-card .thumb.thumb--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Узкие «портретные» карточки под вертикальное видео 9:16 */
.case-card--portrait {
  max-width: min(100%, 340px);
  width: 100%;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.case-card--portrait .body {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}

.case-card .thumb.thumb--video-vertical {
  flex-shrink: 0;
  height: min(70dvh, 580px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 16;
}

.case-card .thumb.thumb--video-vertical video {
  object-fit: cover;
  object-position: center center;
}

@media (max-width: 480px) {
  .case-card--portrait {
    max-width: min(100%, 88vw);
  }

  .case-card .thumb.thumb--video-vertical {
    height: min(62dvh, 520px);
  }
}

.case-card .body {
  padding: 1.5rem;
}

.case-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.case-card .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.case-card .meta a {
  color: #e8ddd9;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(78, 13, 7, 0.9);
  text-underline-offset: 3px;
}

.case-card .meta a:hover {
  color: #fff;
  text-decoration-color: var(--primary);
}

/* Blog grid */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--transition);
}

.post-card:hover {
  border-color: var(--primary);
}

.post-card .thumb {
  aspect-ratio: 16/10;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.post-card .body {
  padding: 1.5rem;
}

.post-card .date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.post-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Team grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.team-card {
  text-align: center;
}

.team-card .avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
  overflow: hidden;
}

.team-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.team-card .role {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.team-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.team-card__blog {
  margin-top: 1rem;
  display: inline-block;
}

.team-reviews-link {
  text-align: center;
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.team-reviews-link p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Legal page */
.legal-content {
  max-width: 720px;
  padding: 2rem 0 4rem;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-content p, .legal-content ul {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.legal-content ul {
  padding-left: 1.5rem;
}

.legal-content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: #fff;
}

/* Footer */
.site-footer {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-nav h4,
.footer-contact h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-nav ul,
.footer-contact ul {
  list-style: none;
}

.footer-nav a,
.footer-contact a {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-nav a:hover,
.footer-contact a:hover {
  color: var(--text);
}

.footer-contact li {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

.footer-social a:hover {
  border-color: var(--primary);
  color: var(--text);
}

.footer-telegram {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--text);
}

.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

@media (max-width: 768px) {
  /*
   * Safari/WebKit: backdrop-filter on an ancestor makes position:fixed descendants
   * use that ancestor as containing block — the menu overlay was only as tall as
   * the header, so links drew on top of page text. Disable blur on the bar on small screens.
   */
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding:
      max(5.25rem, calc(3.5rem + env(safe-area-inset-top, 0px)))
      max(1.25rem, env(safe-area-inset-right, 0px))
      max(1.25rem, env(safe-area-inset-bottom, 0px))
      max(1.25rem, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.35rem;
    width: 100%;
    max-width: 22rem;
    text-align: center;
  }

  .site-nav .nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.65rem 1rem;
    font-size: 1.125rem;
    color: var(--text);
    border-radius: var(--radius);
  }

  .site-nav .nav a:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .site-header .header-tools .header-cta {
    display: none !important;
  }

  .contact-modal {
    align-items: flex-end;
    padding: max(0.5rem, env(safe-area-inset-top, 0px)) 0 0;
  }

  .contact-modal__panel {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 100%);
    border-radius: 12px 12px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 1.5rem 1.25rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }

  .hero {
    min-height: auto;
    padding: 2.75rem 0 2.25rem;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.2rem);
  }

  .hero .subheadline {
    font-size: 0.98rem;
  }

  .page-hero {
    padding: 2.25rem 0 1.75rem;
  }

  .page-hero h1 {
    font-size: clamp(1.5rem, 6vw, 1.95rem);
  }

  .logo img {
    height: 44px;
  }

  .cta-strip {
    padding: 2rem 1.25rem;
  }

  .cta-strip h2 {
    font-size: 1.35rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .section {
    padding: 3.25rem 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}
