/* ===== TOKENS ===== */
:root {
  --bg: #D7D7CF;
  --dark: #16130E;
  --coral: #FF7733;
  --gold: #E6A700;
  --card-bg: #DEDAD7;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --r-pill: 999px;
  --r-card: 16px;
  --section-py: 96px;
  --container: 1200px;
  --transition: 0.4s cubic-bezier(.22,.68,0,1.2);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--dark);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fraunces — variable font. Фиксируем оптический размер,
   чтобы жирность была одинаковой на десктопе и мобильном */
.hero-title,
.section-title,
.cta-title,
.portfolio-banner h2,
.step-num {
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 144;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== CONTAINER ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-dark {
  background: var(--dark);
  color: #fff;
}
.btn-sm {
  padding: 9px 20px;
  font-size: 14px;
}
.btn-light-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid #fff;
}
/* Outline button with corner notches */
.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--dark);
  position: relative;
}
.btn-outline::before,
.btn-outline::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--dark);
  border-style: solid;
}
.btn-outline::before {
  top: -1.5px;
  left: -1.5px;
  border-width: 2px 0 0 2px;
  border-radius: 2px 0 0 0;
}
.btn-outline::after {
  bottom: -1.5px;
  right: -1.5px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 2px 0;
}

/* ===== PILL NAV ===== */
.pill-nav {
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 0 32px;
  pointer-events: none;
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card-bg);
  border-radius: var(--r-pill);
  padding: 8px 14px 8px 24px;
  box-shadow: 0 4px 24px rgba(22,19,14,.08);
  pointer-events: all;
}
.nav-links {
  flex: 1;
  justify-content: center;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  transition: background .15s;
}
.nav-links a:hover {
  background: rgba(22,19,14,.07);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 32px 80px;
}
.hero-content {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--dark);
}
.hero-sub {
  font-size: 18px;
  color: rgba(22,19,14,.65);
  max-width: 460px;
  line-height: 1.6;
}
.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-canvas-wrap {
  width: 100%;
  height: 500px;
  position: relative;
}
#network-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== SECTION SHARED ===== */
.section {
  padding: var(--section-py) 0;
}
.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin-bottom: 48px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--r-card);
  padding: 28px;
}
.card-icon {
  margin-bottom: 16px;
}

/* ===== PAINS GRID ===== */
.pains-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pains-grid .card p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(22,19,14,.8);
}

/* ===== BENTO SERVICES ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bento-wide {
  grid-column: span 3;
}
/* Последняя карточка — обычный размер, по центру (средняя колонка) */
.bento-center {
  grid-column: 2;
}
.bento-card h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.bento-card p {
  font-size: 14px;
  color: rgba(22,19,14,.7);
  line-height: 1.55;
}

/* ===== PROCESS ===== */
.process-section { background: var(--card-bg); }
.process-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.step {
  position: relative;
  padding: 0 24px 0 0;
}
.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.step-connector {
  position: absolute;
  top: 21px;
  left: 44px;
  right: 0;
  height: 1.5px;
  background: rgba(22,19,14,.2);
  z-index: 1;
}
.step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.step p {
  font-size: 13px;
  color: rgba(22,19,14,.65);
  line-height: 1.5;
}

/* ===== TECH ===== */
.tech-intro {
  font-size: 17px;
  color: rgba(22,19,14,.65);
  max-width: 620px;
  line-height: 1.6;
  margin-top: -28px;
  margin-bottom: 44px;
}
.tech-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 48px;
}
.tech-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tech-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(22,19,14,.45);
}
.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tech-badge {
  background: var(--dark);
  color: #D7D7CF;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  letter-spacing: .01em;
  transition: transform .15s, background .15s;
}
.tech-badge:hover {
  transform: translateY(-2px);
}

/* ===== CAROUSEL ===== */
.carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.carousel {
  overflow: hidden;
  flex: 1;
}
.carousel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(.22,.68,0,1.1);
  cursor: grab;
  user-select: none;
}
.carousel-track:active { cursor: grabbing; }
.carousel-card {
  flex: 0 0 calc((100% - 32px) / 3);
  background: var(--card-bg);
  border-radius: var(--r-card);
  padding: 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.case-icon { margin-bottom: 16px; }
.carousel-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
}
.carousel-card p {
  font-size: 14px;
  color: rgba(22,19,14,.72);
  line-height: 1.6;
}
.carousel-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1.5px solid rgba(22,19,14,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.carousel-arrow:hover { background: var(--dark); }
.carousel-arrow:hover svg path { stroke: #fff; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(22,19,14,.2);
  cursor: pointer;
  transition: background .2s, transform .2s;
  border: none;
}
.carousel-dot.active {
  background: var(--dark);
  transform: scale(1.2);
}
.cases-cta {
  margin-top: 32px;
  text-align: center;
}

/* ===== TEAM ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.team-card {
  background: var(--card-bg);
  border-radius: var(--r-card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--coral);
  object-fit: cover;
  background: var(--bg);
}
.team-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.team-role {
  font-size: 13px;
  color: var(--coral);
  font-weight: 500;
}
.team-card p {
  font-size: 14px;
  color: rgba(22,19,14,.7);
  line-height: 1.6;
}
.team-link {
  margin-top: 32px;
  text-align: center;
}
.team-link a {
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1.5px solid var(--dark);
  padding-bottom: 1px;
  transition: opacity .2s;
}
.team-link a:hover { opacity: .6; }

/* ===== PORTFOLIO BANNER ===== */
.portfolio-banner {
  background: var(--dark);
  padding: 80px 0;
  text-align: center;
}
.portfolio-banner h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.5vw, 38px);
  color: #fff;
  font-weight: 700;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== FAQ ===== */
.faq-container {
  max-width: 760px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.faq-item {
  border-bottom: 1.5px solid rgba(22,19,14,.12);
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
.faq-q:hover { color: var(--coral); }
.faq-arrow {
  font-size: 20px;
  transition: transform .3s;
  flex-shrink: 0;
  line-height: 1;
}
.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-a p {
  padding-bottom: 20px;
  font-size: 15px;
  color: rgba(22,19,14,.75);
  line-height: 1.65;
}
.faq-a a {
  color: var(--coral);
  border-bottom: 1px solid currentColor;
}

/* ===== CTA SECTION ===== */
.cta-section { background: var(--card-bg); }
.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cta-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.cta-sub {
  font-size: 18px;
  color: rgba(22,19,14,.6);
}
.cta-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark);
  padding: 56px 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col-center { align-items: center; text-align: center; }
.footer-col-right { align-items: flex-end; text-align: right; }
.footer-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(215,215,207,.5);
  margin-bottom: 4px;
}
.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--bg);
  opacity: .8;
  transition: opacity .2s;
}
.footer-link:hover { opacity: 1; }
.footer-copy {
  font-size: 13px;
  color: rgba(215,215,207,.4);
}


/* ===== LOGO ===== */
/* Десктоп: лого слева в nav-таблетке, крупный */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  pointer-events: all;
}
.nav-logo-img {
  height: 64px;
  width: auto;
  display: block;
}
/* hero-logo показывается только на мобильном (см. медиазапрос) */
.hero-logo {
  display: none;
  justify-content: center;
}
.hero-logo-img {
  height: 62px;
  width: auto;
  display: block;
}

/* ===== SCROLL ANIMATIONS ===== */
.animate-me {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .5s ease, transform .5s ease;
}
.animate-me.visible {
  opacity: 1;
  transform: translateY(0);
}
.carousel-card.animate-me {
  transition: opacity .5s ease, transform .5s ease;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .animate-me { opacity: 1; transform: none; transition: none; }
  .carousel-track { transition: none; }
}

/* ===== RESPONSIVE 768px ===== */
@media (max-width: 768px) {
  :root { --section-py: 56px; }
  .container { padding: 0 18px; }

  .pill-nav { display: none; }

  /* Hero: display:contents на .hero-text делает его детей
     прямыми детьми .hero-content → можно управлять order */
  .hero {
    padding: 36px 0 72px;
    min-height: 100svh;
    align-items: flex-start;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 18px;
    width: 100%;
    max-width: 100%;
  }
  .hero-text { display: contents; }

  /* Лого над заголовком */
  .hero-logo {
    display: flex;
    order: 0;
    justify-content: flex-start;
    margin-bottom: 20px;
  }
  .hero-logo-img { height: 58px; }

  .hero-title {
    order: 1;
    font-size: 30px;
    line-height: 1.1;
    margin-bottom: 0;
  }
  .hero-canvas-wrap {
    order: 2;
    width: calc(100% + 36px);
    margin-left: -18px;
    height: 280px;
    margin-top: 12px;
    margin-bottom: 0;
  }
  .hero-sub {
    order: 3;
    font-size: 15px;
    margin-top: 16px;
    margin-bottom: 20px;
    color: rgba(22,19,14,.65);
    max-width: 100%;
  }
  .hero-btns {
    order: 4;
    flex-direction: column;
    gap: 10px;
  }
  .hero-btns .btn { width: 100%; justify-content: center; }

  .pains-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bento-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bento-wide { grid-column: span 2; }
  .bento-center { grid-column: auto; }

  .process-steps { grid-template-columns: 1fr; gap: 28px; }
  .step-connector { top: 44px; left: 21px; right: auto; width: 1.5px; height: 28px; }

  .carousel-card { flex: 0 0 calc(100% - 8px); }
  .carousel-wrap { gap: 8px; }

  .team-grid { grid-template-columns: 1fr; gap: 14px; }
  .team-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; }
  .team-avatar { width: 64px; height: 64px; flex-shrink: 0; }

  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-col-center, .footer-col-right { align-items: flex-start; text-align: left; }

  .tech-groups { grid-template-columns: 1fr; gap: 24px; }
  .tech-intro { font-size: 15px; margin-top: -16px; margin-bottom: 32px; }

  .section-title { margin-bottom: 28px; }
  .portfolio-banner { padding: 56px 0; }
  .cta-title { font-size: 30px; }
}

/* ===== RESPONSIVE 480px ===== */
@media (max-width: 480px) {
  .pains-grid { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  .bento-center { grid-column: auto; }
  .cta-btns { flex-direction: column; align-items: stretch; }
  .cta-btns .btn { width: 100%; justify-content: center; }
  .hero-title { font-size: 26px; }
}
