:root {
  --bg: #000000;
  --bg-elev: #2b2b2b;
  --text: #ffffff;
  --muted: #c0c0c0;
  --primary: #c0c0c0;
  --accent: #ffffff;
  --card: rgba(43, 43, 43, 0.86);
  --border: rgba(192, 192, 192, 0.26);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

body.light {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --text: #000000;
  --muted: #5a5a5a;
  --primary: #2b2b2b;
  --accent: #000000;
  --card: rgba(255, 255, 255, 0.92);
  --border: rgba(43, 43, 43, 0.2);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #2b2b2b 0%, var(--bg) 52%);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section {
  padding: 88px 0;
  position: relative;
}

.hero.section {
  padding-top: 45px;
}

.section-alt {
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.04), transparent);
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.8);
}

body.light .header {
  background: rgba(255, 255, 255, 0.88);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: clamp(22px, 2.2vw, 28px);
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
}

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

.menu-toggle {
  display: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--primary);
  border: 1px solid rgba(192, 192, 192, 0.42);
  background: rgba(192, 192, 192, 0.11);
  margin-bottom: 14px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 12px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
}

h1 span {
  color: var(--primary);
}

.subtitle,
.section-head p,
.feature-card p,
.process-text p,
.timeline p,
.contact p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  color: #000000;
  background: linear-gradient(135deg, #ffffff, #c0c0c0);
  box-shadow: 0 12px 30px rgba(192, 192, 192, 0.25);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--card);
}

.hero-visual {
  min-height: 560px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
}

.hero-video-card {
  position: relative;
  width: min(420px, 95%);
  z-index: 2;
  margin-top: 0;
}

.floating-tag {
  position: absolute;
  padding: 8px 12px;
  background: rgba(192, 192, 192, 0.15);
  border: 1px solid rgba(192, 192, 192, 0.4);
  border-radius: 10px;
  font-size: 12px;
}

.tag-2 {
  bottom: 52px;
  right: 22px;
}

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

.section-head h2 {
  font-size: clamp(28px, 3.6vw, 42px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 26px 20px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
}

.stat-value::after {
  content: "%";
  font-size: 22px;
  margin-left: 3px;
}

.stat:nth-child(3) .stat-value::after {
  content: "/7";
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.pillars {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}

.pillar {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 24px 28px;
}

.pillar h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.pillar p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
}

.pillar p:last-of-type {
  margin-bottom: 0;
}

.pillar-focus {
  font-size: 14px;
  color: var(--primary);
  opacity: 0.95;
}

#about-us .section-head {
  margin-top: 32px;
}

.about-lead-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.about-lead-photo {
  flex-shrink: 0;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

.about-lead-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-lead {
  max-width: 640px;
  margin: 0;
}

#other-projects {
  padding-bottom: 120px;
}

.other-projects-subtitle {
  margin: 12px 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.other-projects-video {
  margin-top: 24px;
  width: 100%;
}

.other-projects-video video {
  width: 100%;
  display: block;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.other-projects-breakthroughs {
  margin-top: 28px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.about-block {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 22px 24px;
}

.about-block h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--primary);
}

.about-block ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 15px;
}

.about-block li {
  margin-bottom: 10px;
}

.about-block li:last-child {
  margin-bottom: 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.5);
}

.solution-card {
  display: block;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.solution-card::after {
  content: "Go to section →";
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--primary);
  opacity: 0.9;
}

.icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.process-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: start;
}

.rover-section {
  position: relative;
  padding-top: 28px;
}

.rover-transition {
  width: min(900px, 92%);
  margin: 0 auto 30px;
  text-align: center;
  color: var(--muted);
  font-size: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rover-transition span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.rover-transition span::before,
.rover-transition span::after {
  content: "";
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.rover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.rover-intro p {
  color: var(--muted);
  line-height: 1.75;
}

.rover-specs {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rover-specs article {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 14px;
}

.rover-specs h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--muted);
}

.rover-specs p {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.rover-hero-image {
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.rover-hero-image img,
.gallery-card img {
  width: 100%;
  display: block;
}

.rover-gallery {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gallery-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.5);
}

.gallery-card figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}

.rover-details {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.spec-text {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 20px;
}

.spec-text p,
.spec-text li {
  color: var(--muted);
  line-height: 1.7;
}

.spec-text ul {
  margin: 0;
  padding-left: 18px;
}

.compare-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 20px;
}

.compare-wrap h3 {
  margin-bottom: 10px;
}

.compare-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.compare-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
}

.compare-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
}

.compare-table td {
  color: var(--muted);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.optimus-row td {
  color: var(--text);
  font-weight: 600;
  background: rgba(192, 192, 192, 0.08);
}

.rover-facts {
  margin-top: 14px;
}

.rover-facts p,
.rover-facts li {
  color: var(--muted);
  line-height: 1.7;
}

.rover-facts ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.dog-section {
  border-top: 1px solid var(--border);
}

.dog-hero-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 16px;
}

.dog-hero-row .dog-hero-image {
  width: 100%;
  margin: 0;
  min-height: 0;
}

.dog-hero-row .dog-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.dog-hero-row .dog-hero-video {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.dog-hero-row .dog-hero-video video {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dog-hero-image {
  width: 50%;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.dog-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.dog-hero-video {
  width: 100%;
}

.dog-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-auto-rows: minmax(240px, 38vh);
  gap: 20px;
  align-items: stretch;
}

.dog-grid .gallery-card:first-child {
  height: 92%;
  align-self: start;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dog-grid .gallery-card:first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.dog-grid .gallery-card:last-child {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 92%;
  align-self: start;
}

.dog-grid .gallery-card:last-child img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: bottom;
}

.dog-grid .gallery-card:last-child figcaption {
  flex-shrink: 0;
}

.dog-video-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.dog-video-grid .dog-video-full {
  width: 100%;
  max-width: none;
}

.video-card {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 0;
}

.rover-video-card {
  width: 50%;
}

.video-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.video-card video {
  width: 100%;
  display: block;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 16px;
}

.timeline-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #000000;
  background: linear-gradient(135deg, #ffffff, #c0c0c0);
  font-weight: 700;
}

.contact {
  text-align: center;
  max-width: 700px;
}

.contact .btn {
  margin-top: 10px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

.bg-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
}

.bg-glow-1 {
  top: -100px;
  left: -100px;
  background: #c0c0c0;
}

.bg-glow-2 {
  right: -120px;
  bottom: -120px;
  background: #2b2b2b;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-grid,
  .process-grid,
  .rover-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .stats-grid,
  .rover-specs,
  .dog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ——— Mobile (≤720px) ——— */
@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, 1100px);
    margin-left: auto;
    margin-right: auto;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* Центрирование контента на мобильных */
  .hero-content {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-grid {
    justify-items: center;
  }

  .hero-visual {
    justify-content: center;
  }

  .section-head,
  .section-head h2,
  .section-head p {
    text-align: center;
  }

  .section-head {
    margin-left: auto;
    margin-right: auto;
  }

  .cards-grid {
    justify-items: center;
  }

  .feature-card {
    text-align: center;
  }

  .stats-grid {
    justify-items: center;
  }

  .stat {
    text-align: center;
  }

  .rover-intro {
    text-align: center;
  }

  .rover-intro h2,
  .rover-intro p {
    text-align: center;
  }

  .rover-specs {
    justify-items: center;
  }

  .rover-specs article {
    text-align: center;
  }

  .dog-section .section-head,
  .dog-section .section-head p {
    text-align: center;
  }

  .gallery-card {
    text-align: center;
  }

  .gallery-card figcaption {
    text-align: center;
  }

  .other-projects-subtitle,
  #other-projects .section-head p {
    text-align: center;
  }

  .other-projects-breakthroughs {
    text-align: left;
  }

  .about-block h3 {
    text-align: center;
  }

  .pillar h3 {
    text-align: center;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    padding: 6px 10px;
    -webkit-tap-highlight-color: transparent;
  }

  .nav {
    min-height: 56px;
  }

  .nav-links {
    position: absolute;
    right: 12px;
    top: 100%;
    margin-top: 4px;
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elev);
    padding: 12px;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 12px 14px;
    min-height: 44px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .logo {
    font-size: clamp(22px, 5.5vw, 26px);
  }

  .hero.section {
    padding-top: 24px;
  }

  .hero-grid {
    gap: 28px;
  }

  h1 {
    font-size: clamp(26px, 7vw, 40px);
    line-height: 1.2;
  }

  .subtitle,
  .section-head p {
    font-size: 15px;
  }

  .hero-actions {
    margin-top: 20px;
    gap: 10px;
  }

  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }

  .contact .btn {
    min-width: 120px;
  }

  .hero-visual {
    min-height: 360px;
  }

  .hero-video-card {
    width: 100%;
  }

  .rover-video-card {
    width: 100%;
  }

  .section {
    padding: 56px 0;
  }

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

  .section-head h2 {
    font-size: clamp(24px, 6vw, 32px);
  }

  .cards-grid,
  .stats-grid,
  .rover-gallery,
  .rover-specs,
  .dog-grid {
    grid-template-columns: 1fr;
  }

  .dog-hero-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dog-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 16px;
  }

  /* Как у rover-gallery: обычные карточки без flex/height — картинка + подпись по высоте */
  .dog-grid .gallery-card:first-child,
  .dog-grid .gallery-card:last-child {
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
    align-self: auto;
    grid-column: auto;
    overflow: visible;
  }

  .dog-grid .gallery-card:first-child img,
  .dog-grid .gallery-card:last-child img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: initial;
    object-position: initial;
    flex: none;
  }

  .dog-grid .gallery-card:last-child figcaption {
    flex: none;
  }

  .rover-transition {
    font-size: 14px;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
  }

  .rover-transition span::before,
  .rover-transition span::after {
    width: 40px;
  }

  .about-lead-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 20px;
    gap: 16px;
  }

  .about-lead-photo {
    width: 160px;
    height: 160px;
  }

  .about-lead {
    text-align: center;
  }

  #about-us .section-head {
    margin-top: 20px;
  }

  .about-grid {
    gap: 16px;
  }

  .about-block {
    padding: 18px 20px;
  }

  .about-block h3 {
    font-size: 16px;
  }

  .about-block li {
    font-size: 14px;
  }

  #other-projects {
    padding-bottom: 64px;
  }

  .other-projects-subtitle {
    font-size: 18px;
  }

  .other-projects-video {
    margin-top: 16px;
  }

  .other-projects-breakthroughs {
    margin-top: 20px;
  }

  .pillar {
    padding: 18px 20px;
  }

  .pillar h3 {
    font-size: 16px;
  }

  .pillar p {
    font-size: 14px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .rover-details {
    margin-top: 12px;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }

  .spec-text,
  .compare-wrap {
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
  }

  .spec-text h3,
  .compare-wrap h3 {
    font-size: 18px;
    margin-bottom: 8px;
    text-align: center;
  }

  .spec-text p,
  .spec-text li,
  .compare-wrap .rover-facts p,
  .compare-wrap .rover-facts li {
    font-size: 14px;
  }

  .spec-text ul,
  .compare-wrap .rover-facts ul {
    padding-left: 20px;
  }

  .compare-scroll {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    overflow-x: auto;
  }

  .compare-table {
    min-width: 520px;
    font-size: 12px;
  }

  .compare-table th,
  .compare-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .compare-wrap .rover-facts {
    margin-top: 12px;
    font-size: 14px;
  }

  .footer {
    padding: 20px 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  }
}

/* ——— Small phones (≤480px) ——— */
@media (max-width: 480px) {
  .container {
    width: min(100% - 20px, 1100px);
  }

  .section {
    padding: 44px 0;
  }

  h1 {
    font-size: clamp(22px, 6.5vw, 28px);
  }

  .section-head h2 {
    font-size: clamp(22px, 5.5vw, 28px);
  }

  .hero-grid {
    gap: 20px;
  }

  .about-lead-photo {
    width: 120px;
    height: 120px;
  }

  .rover-specs {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 18px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}
