/* Александр Андронов — видеонаблюдение. Tokens: DESIGN.md */

:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.012 230);
  --ink: oklch(0.22 0.035 230);
  --muted: oklch(0.45 0.028 230);
  --primary: oklch(0.42 0.11 230);
  --primary-deep: oklch(0.32 0.1 230);
  --accent: oklch(0.68 0.145 75);
  --accent-on: oklch(0.99 0 0);
  --line: oklch(0.88 0.015 230);
  --ok: oklch(0.45 0.12 150);
  --danger: oklch(0.52 0.18 25);

  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-body: "Red Hat Text", system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: clamp(2.5rem, 5vw, 4.5rem);
  --space-2xl: clamp(3.5rem, 8vw, 7rem);

  --shell: min(1120px, calc(100% - 2.5rem));
  --radius: 0.35rem;
  --header-h: 4.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --z-header: 40;
  --z-skip: 50;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--primary-deep);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md);
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
}

p {
  margin: 0 0 var(--space-md);
  max-width: 68ch;
}

p:last-child {
  margin-bottom: 0;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: var(--z-skip);
  background: var(--primary);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px oklch(0.22 0.035 230 / 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--header-h);
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

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

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.logo-tag {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
}

.nav {
  display: none;
  flex-wrap: nowrap;
  gap: clamp(0.65rem, 1.2vw, 1.15rem);
  margin-inline: auto;
  min-width: 0;
}

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

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.phone-link {
  display: none;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
}

.phone-link:hover {
  color: var(--primary);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  padding: 0.55rem;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.mobile-nav[hidden] {
  display: none;
}

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

.mobile-nav .phone-link {
  display: block;
  border-bottom: 0;
  color: var(--primary);
  margin-top: 0.5rem;
}

/* Desktop nav needs ~1100px: logo + 6 links + phone + CTA.
   Below that (iPad landscape / small laptop) keep compact header. */
@media (min-width: 1100px) {
  .nav {
    display: flex;
  }

  .phone-link {
    display: inline;
  }

  .nav-toggle,
  .mobile-nav {
    display: none !important;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  padding: 0.95rem 1.4rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.2s ease, box-shadow 0.25s var(--ease-out);
}

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

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 10px 28px oklch(0.72 0.14 75 / 0.35);
}

.btn-accent:hover {
  color: var(--accent-on);
  background: oklch(0.62 0.15 75);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  color: white;
  background: var(--primary-deep);
}

.btn-ghost {
  background: transparent;
  color: white;
  border: 1.5px solid oklch(1 0 0 / 0.45);
}

.btn-ghost:hover {
  color: white;
  background: oklch(1 0 0 / 0.1);
  border-color: white;
}

/* Hero */

.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: flex-end;
  color: white;
  overflow: hidden;
  scroll-margin-top: 0;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 20%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      oklch(0.22 0.06 230 / 0.92) 0%,
      oklch(0.28 0.07 230 / 0.72) 42%,
      oklch(0.35 0.05 230 / 0.35) 100%
    ),
    linear-gradient(to top, oklch(0.18 0.05 230 / 0.75) 0%, transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: clamp(5rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem);
  /* Align to shell left edge; invalid 4-value margin-inline was centering on tablet */
  width: min(40rem, var(--shell));
  max-width: 40rem;
  margin-inline-start: max(1.25rem, calc((100% - var(--shell)) / 2));
  margin-inline-end: auto;
  animation: hero-in 0.9s var(--ease-out) both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-place {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: oklch(0.88 0.04 75);
  margin-bottom: var(--space-sm);
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-md);
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: oklch(0.92 0.01 230);
  margin-bottom: var(--space-lg);
  max-width: 36ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */

.section {
  padding-block: var(--space-2xl);
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.section-lead {
  color: var(--muted);
  margin-bottom: var(--space-xl);
  font-size: 1.1rem;
}

[data-reveal] {
  opacity: 1;
  transform: none;
}

[data-reveal].is-ready {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* About */

.about {
  background: var(--bg);
}

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

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
    gap: clamp(2rem, 4vw, 4rem);
  }
}

.about-copy p {
  font-size: 1.1rem;
}

.about-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.about-points li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.about-points strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--primary);
}

.about-points span {
  color: var(--muted);
}

@media (max-width: 520px) {
  .about-points li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* Problems */

.problems {
  background: var(--surface);
}

.problem-list {
  display: flex;
  flex-direction: column;
}

.problem-row {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.problem-row:first-child {
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .problem-row {
    grid-template-columns: minmax(14rem, 0.42fr) 1fr;
    gap: 2rem;
    align-items: baseline;
    padding: 1.75rem 0;
  }
}

.problem-row h3 {
  margin: 0;
  color: var(--primary-deep);
}

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

/* Solutions */

.solutions-layout {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .solutions-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "intro visual"
      "list visual";
    column-gap: clamp(1.75rem, 3vw, 3.5rem);
    align-items: start;
  }

  .solutions-intro {
    grid-area: intro;
  }

  .solutions-visual {
    grid-area: visual;
  }

  .solutions-list {
    grid-area: list;
  }
}

/* Tablet: two photos side-by-side under intro, before the list */
@media (min-width: 700px) and (max-width: 1023px) {
  .solutions-visual {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

.solutions-visual {
  display: grid;
  gap: 0.75rem;
}

.solutions-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
}

.solutions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.solutions-list li {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.solutions-list li:first-child {
  border-top: 1px solid var(--line);
}

.sol-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.sol-text {
  color: var(--muted);
  font-size: 0.98rem;
}

/* Clients */

.clients-sub {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
}

.logo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 0.75rem;
}

.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink);
}

.logo-slot img {
  max-width: 88%;
  max-height: 2.65rem;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1) contrast(1.08);
  opacity: 0.92;
  transition: filter 0.25s var(--ease-out), opacity 0.25s var(--ease-out);
}

.logo-slot:hover img {
  filter: grayscale(0.35) contrast(1.05);
  opacity: 1;
}

.logo-slot span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.2;
}

.logo-grid-strong .logo-slot {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.logo-grid-strong .logo-slot span {
  color: var(--ink);
}

/* Keyword cloud */

.keywords {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: var(--space-xl);
}

.keywords-layout {
  display: grid;
  gap: var(--space-lg);
  align-items: start;
}

@media (min-width: 1024px) {
  .keywords-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
    align-items: center;
  }
}

.keywords h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  margin-bottom: var(--space-sm);
}

.keywords .section-lead {
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.keyword-cloud {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
}

.keyword-cloud li {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--primary-deep);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  letter-spacing: -0.01em;
}

.keywords-visual {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  max-width: 28rem;
  margin-inline: auto;
}

.keywords-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

@media (min-width: 1024px) {
  .keywords-visual {
    max-width: none;
    margin-inline: 0;
  }
}

@media (min-width: 700px) and (max-width: 1023px) {
  .keywords-visual {
    max-width: 22rem;
  }
}

/* FAQ */

.faq {
  background: var(--surface);
}

.faq-layout {
  max-width: 720px;
}

.accordion {
  border-top: 1px solid var(--line);
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1.2rem 2rem 1.2rem 0;
  position: relative;
}

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

.acc-item summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}

.acc-item[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.acc-panel {
  padding: 0 0 1.25rem;
}

.acc-panel p {
  color: var(--muted);
}

/* Forms */

.order {
  background:
    linear-gradient(160deg, var(--primary-deep), var(--primary));
  color: white;
}

.order h2,
.order .section-lead,
.order .order-direct {
  color: white;
}

.order .section-lead {
  opacity: 0.88;
}

.order-direct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-top: var(--space-md);
}

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

.order-direct a:hover {
  color: oklch(0.82 0.12 75);
}

.order-direct span {
  opacity: 0.7;
  font-weight: 500;
  font-size: 1rem;
  margin-left: 0.35rem;
}

.order-layout {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 960px) {
  .order-layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: var(--bg);
  color: var(--ink);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: calc(var(--radius) + 0.15rem);
  box-shadow: 0 20px 50px oklch(0.15 0.04 230 / 0.35);
}

.form-title {
  margin: 0 0 0.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  width: 100%;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: oklch(0.55 0.02 230);
  opacity: 1;
}

.form-hint {
  color: var(--danger);
  font-size: 0.92rem;
  margin: 0;
}

.form-ok {
  color: var(--ok);
  font-size: 0.95rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: oklch(0.95 0.03 150);
  border-radius: var(--radius);
}

.form-ok a {
  color: var(--ok);
  font-weight: 600;
}

.form .btn {
  align-self: flex-start;
}

.contacts-layout {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 960px) {
  .contacts-layout {
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.75rem, 3vw, 3rem);
    align-items: start;
  }
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.contact-list a,
.contact-list span:not(.contact-label) {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--ink);
}

.contact-list a:hover {
  color: var(--primary);
}

.form-compact {
  box-shadow: none;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-lg);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.footer-inner strong {
  display: block;
  font-family: var(--font-display);
}

.footer-inner span {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .header-actions .btn-sm {
    display: none;
  }

  .hero-content {
    margin-inline: auto;
    width: var(--shell);
    max-width: none;
  }
}

/* Comfortable tablet / small-laptop band */
@media (min-width: 641px) and (max-width: 1099px) {
  .header-inner {
    gap: var(--space-sm);
  }

  .nav a {
    white-space: nowrap;
  }

  .about-points li {
    grid-template-columns: minmax(6.5rem, 7.5rem) 1fr;
  }

  .logo-slot {
    min-height: 4.5rem;
    padding: 0.75rem 0.85rem;
  }

  .logo-slot span {
    font-size: 0.88rem;
  }

  .keyword-cloud li {
    font-size: 0.8rem;
  }
}
