/* ==========================================================================
   СК «Территория» — design tokens
   ========================================================================== */

:root {
  --ink: #15171a;
  --ink-soft: #2a2d31;
  --paper: #f6f4ef;
  --paper-dim: #ece8e0;
  --line: #ddd7cb;
  --accent: #b97a4d;
  --accent-light: #d79a6e;
  --muted: #6b6a65;
  --muted-on-dark: #a9a9a4;
  --white: #ffffff;

  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1240px;
  --radius: 2px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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, h1, h2, h3, h4, p, figure, dl, dd, ol, ul {
  margin: 0;
}

ul[class], ol[class] { list-style: none; padding: 0; }

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

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

button, input, select { font: inherit; color: inherit; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  max-width: 18ch;
}

h3 { font-size: 1.25rem; }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-block;
}
.section-eyebrow-light { color: var(--accent-light); }

.section-lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 56ch;
  margin-top: 18px;
}
.section-lead-light { color: var(--muted-on-dark); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

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

.btn-ghost {
  border-color: currentColor;
  color: inherit;
  background: transparent;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.btn-sm { padding: 10px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 300;
  background: rgba(21, 23, 26, 0);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header.scrolled {
  background: rgba(21, 23, 26, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  color: var(--paper);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: inline-flex;
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 32px;
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--paper);
  opacity: 0.82;
  position: relative;
  padding: 6px 0;
  transition: opacity .2s var(--ease);
}
.main-nav a:hover { opacity: 1; }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-phone {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--paper);
  opacity: 0.85;
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 260;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--paper);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1020px) {
  .header-phone { display: inline-block; }
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 880px) {
  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 250;
    padding-top: 80px;
    background: var(--ink);
    height: 100dvh;
    flex-direction: column;
    padding-inline: 32px;
    padding-bottom: 32px;
    gap: 24px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .main-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .header-actions .btn { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--paper);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21,23,26,0.55) 0%, rgba(21,23,26,0.38) 35%, rgba(21,23,26,0.78) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 160px;
  padding-bottom: 88px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
  color: var(--paper);
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  max-width: 18ch;
  margin-bottom: 24px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hero-lead {
  font-size: 1.15rem;
  max-width: 50ch;
  color: rgba(246,244,239,0.88);
  margin-bottom: 36px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 32px;
  max-width: 760px;
  border-top: 1px solid rgba(246,244,239,0.22);
  padding-top: 28px;
}
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--accent-light);
}
.hero-stats dd {
  margin-top: 6px;
  font-size: 0.88rem;
  color: rgba(246,244,239,0.88);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.scroll-hint {
  position: absolute;
  right: 32px;
  bottom: 36px;
  z-index: 1;
  width: 26px;
  height: 44px;
  border: 1px solid rgba(246,244,239,0.5);
  border-radius: 14px;
  display: none;
}
.scroll-hint span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--paper);
  animation: scrollDown 1.8s infinite var(--ease);
}
@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(16px); opacity: 0; }
  100% { opacity: 0; }
}
@media (min-width: 760px) { .scroll-hint { display: block; } }

@media (max-width: 600px) {
  .hero-stats { grid-template-columns: 1fr; gap: 18px; }
  .hero-content { padding-top: 130px; padding-bottom: 56px; }
}

/* ==========================================================================
   Concerns
   ========================================================================== */

.concerns { padding: 120px 0 100px; }

.concerns-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1px;
  background: var(--line);
  margin-top: 56px;
  border: 1px solid var(--line);
}

.concern-card {
  background: var(--paper);
  padding: 44px 40px;
  transition: background-color .3s var(--ease);
}
.concern-card:hover { background: var(--paper-dim); }

.concern-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 18px;
}

.concern-card h3 { margin-bottom: 14px; }
.concern-card p { color: var(--muted); font-size: 0.98rem; }

@media (max-width: 760px) {
  .concerns-grid { grid-template-columns: 1fr; }
  .concern-card { padding: 36px 28px; }
}

/* ==========================================================================
   Process / timeline
   ========================================================================== */

.process {
  padding: 100px 0 120px;
  background: var(--paper-dim);
}

.timeline {
  margin-top: 64px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line);
}

.timeline-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 28px;
  padding-bottom: 56px;
  position: relative;
}
.timeline-step:last-child { padding-bottom: 0; }

.timeline-marker {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.timeline-body { padding-top: 8px; }
.timeline-body h3 { margin-bottom: 10px; }
.timeline-body p { color: var(--muted); max-width: 62ch; }

@media (max-width: 600px) {
  .timeline::before { left: 23px; }
  .timeline-marker { width: 48px; height: 48px; font-size: 0.8rem; }
  .timeline-step { grid-template-columns: 48px 1fr; gap: 18px; }
}

/* ==========================================================================
   Guarantees (dark)
   ========================================================================== */

.guarantees {
  background: var(--ink);
  color: var(--paper);
  padding: 120px 0;
}

.guarantees-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: center;
}

.guarantee-list {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.guarantee-list li {
  padding-left: 28px;
  position: relative;
}
.guarantee-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 1px;
  background: var(--accent-light);
}
.guarantee-list strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.guarantee-list span {
  color: var(--muted-on-dark);
  font-size: 0.95rem;
}

.guarantees-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .guarantees-grid { grid-template-columns: 1fr; gap: 48px; }
  .guarantees-media { order: -1; }
  .guarantees-media img { aspect-ratio: 16/10; }
}

/* ==========================================================================
   Team
   ========================================================================== */

.team { padding: 120px 0; }

.team-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 72px;
  align-items: center;
}

.team-media img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius);
}

.team-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 28px;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.team-point-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.team-point p { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 900px) {
  .team-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .team-points { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================================
   Projects
   ========================================================================== */

.projects { padding: 100px 0 0; background: var(--paper-dim); }
.projects .container { padding-bottom: 56px; }

.projects-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.project-card {
  position: relative;
  overflow: hidden;
  grid-column: span 2;
  aspect-ratio: 4/3;
}
.project-card-lg {
  grid-column: span 4;
  grid-row: span 2;
  aspect-ratio: auto;
}

.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.project-card:hover img { transform: scale(1.06); }

.project-card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--paper);
  background: linear-gradient(0deg, rgba(21,23,26,0.85) 0%, rgba(21,23,26,0) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.project-card:hover figcaption,
.project-card:focus-within figcaption { opacity: 1; transform: translateY(0); }

.project-card figcaption span:first-child { font-weight: 600; }
.project-card figcaption span:last-child { font-size: 0.82rem; opacity: 0.78; font-family: var(--font-mono); }

@media (max-width: 900px) {
  .projects-gallery { grid-template-columns: repeat(2, 1fr); }
  .project-card, .project-card-lg { grid-column: span 1; grid-row: span 1; aspect-ratio: 4/3; }
  .project-card figcaption { opacity: 1; transform: none; }
}

/* ==========================================================================
   Control
   ========================================================================== */

.control { padding: 120px 0; }

.control-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 72px;
  align-items: center;
}

.control-media img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius);
}

.control-list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.control-list li {
  padding-left: 24px;
  position: relative;
  color: var(--muted);
  font-size: 0.98rem;
}
.control-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  background: var(--accent);
}

@media (max-width: 900px) {
  .control-inner { grid-template-columns: 1fr; gap: 40px; }
  .control-media { order: -1; }
  .control-media img { aspect-ratio: 16/10; }
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq { padding: 120px 0; background: var(--paper-dim); }

.faq-list { margin-top: 48px; max-width: 840px; }

.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 26px 36px 26px 0;
  font-weight: 600;
  font-size: 1.05rem;
  position: relative;
  transition: color .2s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 22px;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }

.faq-item p {
  color: var(--muted);
  padding-bottom: 28px;
  max-width: 68ch;
  animation: faqOpen .25s var(--ease);
}

@keyframes faqOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  position: relative;
  padding: 140px 0;
  color: var(--paper);
  overflow: hidden;
}
.contact-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.contact-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.contact-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(21,23,26,0.94) 0%, rgba(21,23,26,0.86) 45%, rgba(21,23,26,0.55) 100%);
}

.contact-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 80px;
  align-items: start;
}

.contact-points {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-points li {
  padding-left: 24px;
  position: relative;
  color: rgba(246,244,239,0.85);
}
.contact-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 14px; height: 1px;
  background: var(--accent-light);
}

.contact-form {
  background: var(--paper);
  color: var(--ink);
  padding: 44px;
  border-radius: var(--radius);
}
.contact-form h3 { margin-bottom: 28px; }

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.form-row input, .form-row select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.95rem;
  transition: border-color .2s var(--ease);
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--accent);
}

.form-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.5;
}
.form-note a { text-decoration: underline; }

.form-success {
  margin-top: 16px;
  padding: 14px 16px;
  background: #e9f3ea;
  color: #2c6b3a;
  font-size: 0.9rem;
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .contact { padding: 100px 0; }
}
@media (max-width: 520px) {
  .contact-form { padding: 30px 24px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--muted-on-dark);
  padding: 80px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand p { margin-top: 18px; font-size: 0.92rem; max-width: 34ch; }
.footer-brand .logo { color: var(--paper); }

.footer-nav, .footer-contacts, .footer-legal { display: flex; flex-direction: column; gap: 12px; }
.footer-nav h4, .footer-contacts h4, .footer-legal h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper);
  margin-bottom: 6px;
}
.footer-nav a, .footer-contacts a {
  font-size: 0.92rem;
  transition: color .2s var(--ease);
}
.footer-nav a:hover, .footer-contacts a:hover { color: var(--accent-light); }
.footer-legal p { font-size: 0.88rem; line-height: 1.6; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 28px;
  font-size: 0.82rem;
}
.back-to-top { color: var(--accent-light); }

@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
