/* -----------------------------------------------------------------------------
  Минималистичный лендинг: базовые переменные и стили
  Важно: основные правки делаются через CSS-переменные и блоки "контакты/брейкпоинт" в main.js
----------------------------------------------------------------------------- */

:root {
  /* Палитра (спокойная, благородная) */
  --bg: #f6f2ea;                /* чуть теплее/чище, менее “синтетично” */
  --text: #0f172a;              /* немного глубже, “графитнее” */
  --muted: #475569;             /* спокойнее, менее “зелёный” оттенок */
  --primary: #14265f;           /* оставляем: твой глубокий синий */
  --danger-accent: #9f1239;     /* благороднее, тише, ближе к винному */
  --surface: #ffffff;
  --border: rgba(15, 23, 42, 0.10); /* чуть мягче *
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.10); /* чуть “материальнее” */

  /* Градиенты (мягко, без “глянца”) */
  /* Базовый градиент (для h1/бренда): очень мягкий, “тихий” */
  --text-gradient: linear-gradient(135deg, var(--text) 0%, rgba(30, 58, 138, 0.92) 100%);
  /* Более читаемый градиент для коротких h2: быстрый переход в первые ~18% ширины элемента */
  --text-gradient-h2: linear-gradient(90deg, var(--text) 0%, var(--primary) 18%, var(--primary) 100%);
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #2d4a9e 55%, #3b5cba 100%);

  /* Геометрия */
  --radius: 10px;               /* оставляем */
  --radius-lg: 12px;            /* меньше “пухлости”, строже */

  /* Разделитель между секциями */
  --divider-w: 26px;
  --divider-h: 3px;
  --divider-sep: 10px;
  --divider-angle: -30deg;

  /* Анимация hero-anchor: задержки между строками */
  --hero-anchor-delay-1: 0ms;
  --hero-anchor-delay-step: 500ms;

  /* Типографика и ритм */
  --container: 1040px;
  --pad-x: 24px !important;
  --pad-y: 48px;                /* чуть больше воздуха между секциями */

  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}


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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
}

/* Градиент заголовков (h1/h2), без анимаций */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: var(--text-gradient);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }

  h2 {
    background: var(--text-gradient-h2);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 var(--pad-x);
  background: rgba(245, 246, 248, 0.85);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 220ms ease;
}

.page-header .container {
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  transition: opacity 160ms ease;
}

.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name {
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: 10px 10px;
  border-radius: 10px;
  position: relative;
  transition: background 180ms ease, color 180ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 260ms ease;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(18, 24, 38, 0.06);
}

.lang-switch-button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.lang-switch-button.is-active {
  background: var(--primary-gradient);
  color: #fff;
}

.page-main {
  flex: 1 0 auto;
}

.section {
  padding: var(--pad-y) var(--pad-x);
  position: relative;
}

/* Разделитель привязан к .container внутри следующей секции */
.section + .section > .container {
  position: relative;
}

.section + .section > .container::before,
.section + .section > .container::after {
  content: "";
  position: absolute;
  /* Поднимаем псевдоэлементы на уровень верхней границы секции (контейнер внутри padding) */
  top: calc(var(--pad-y) * -1);
  width: var(--divider-w);
  height: var(--divider-h);
  background: var(--danger-accent);
  border-radius: 2px;
  z-index: 2;
  opacity: 0.92;
  pointer-events: none;
}

/* Гарантированно выключаем старую привязку разделителя к .section (если где-то осталась/закешировалась) */
.section + .section::before,
.section + .section::after {
  content: none !important;
  display: none !important;
}

.section + .section > .container::before {
  transform: translateY(calc(var(--divider-sep) * -0.5)) rotate(var(--divider-angle));
}

.section + .section > .container::after {
  transform: translateY(calc(var(--divider-sep) * 0.5)) rotate(var(--divider-angle));
}

.section + .section > .container::before,
.section + .section > .container::after {
  left: 0 !important;
  right: auto !important;
}

@supports (inset-inline-start: 0) {
  .section + .section > .container::before,
  .section + .section > .container::after {
    left: auto !important;
    right: auto !important;
    inset-inline-start: 0 !important;
  }
}

@supports not (inset-inline-start: 0) {
  html[dir="rtl"] .section + .section > .container::before,
  html[dir="rtl"] .section + .section > .container::after {
    left: auto !important;
    right: 0 !important;
  }
}

.section-title {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-text {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 78ch;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* -----------------------------------------------------------
  Смысловой выносной блок (внутри «Мои принципы»)
----------------------------------------------------------- */
.approach-note {
  margin-top: 18px;
  max-width: 74ch;
  padding: 12px 14px;
  background: rgba(250, 245, 240, 0.65);
  border-radius: var(--radius);
}

.approach-note .text-block {
  gap: 6px;
}

.note-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.approach-note .note-text:first-child {
  color: var(--text);
  font-weight: 500;
}

/* -----------------------------------------------------------
  Типографика текста без <br> — ритм через ширину строки и интервалы
----------------------------------------------------------- */
.section .container {
  max-width: var(--container);
  padding: 0;
}

.section p {
  max-width: 74ch;
}

.section-hero .hero-content {
  max-width: 74ch;
}

.section-hero .hero-content > * {
  max-width: 74ch;
  width: 100%;
  width: -webkit-fill-available;
}

.section .text-block p:first-child {
  color: var(--text);
}

.section:not(.section-hero) .text-block p:first-child {
  font-weight: 500;
  letter-spacing: -0.005em;
}

.nowrap {
  white-space: normal;
}

.text-block {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.lang-ru .text-block-ru,
.lang-en .text-block-en,
.lang-he .text-block-he {
  display: flex;
}

.text-block .section-text {
  margin: 0;
}

/* -----------------------------------------------------------
  Micro-cards: визуальная структуризация (Практика)
----------------------------------------------------------- */
.micro-cards {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.micro-card {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  max-width: calc(50% - var(--pad-x) / 2);
  min-width: 152px;
}

.micro-card::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(20, 38, 95, 0) 0%,
    rgba(20, 38, 95, 0.40) 50%,
    rgba(20, 38, 95, 0) 100%
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 260ms ease;
  pointer-events: none;
}

/* -----------------------------------------------------------
  Chips: инструменты как “якоря” (Инструменты)
----------------------------------------------------------- */
.chips {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 74ch;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(30, 58, 138, 0.06);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.chip-icon {
  color: rgba(30, 58, 138, 0.85);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-icon-svg {
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.chip-icon-svg[data-icon="tilda"] {
  -webkit-mask-image: url("../img/icons/tilda.svg");
  mask-image: url("../img/icons/tilda.svg");
}

.chip-icon-svg[data-icon="wix"] {
  -webkit-mask-image: url("../img/icons/wix.svg");
  mask-image: url("../img/icons/wix.svg");
}

.chip-icon-svg[data-icon="getcourse"] {
  -webkit-mask-image: url("../img/icons/getcourse.svg");
  mask-image: url("../img/icons/getcourse.svg");
}

.chip-icon-svg[data-icon="apps_script"] {
  -webkit-mask-image: url("../img/icons/apps_script.svg");
  mask-image: url("../img/icons/apps_script.svg");
}

.chip-icon-svg[data-icon="java-script"] {
  -webkit-mask-image: url("../img/icons/java-script.svg");
  mask-image: url("../img/icons/java-script.svg");
}

.chip-icon-text {
  font-size: 11px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* -----------------------------------------------------------
  HERO — строгий ритм, тёплый тон, фото как присутствие
----------------------------------------------------------- */

.section-hero {
  padding-top: 64px;
  padding-bottom: calc(var(--pad-y) + 8px);
}

body.mobile .section-hero {
  padding-top: var(--pad-x);
}

.hero-inner {
  display: flex;
}

.hero-layout {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
}

.hero-content {
  max-width: 74ch;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.hero-lead {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
}

.hero-text {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.hero-anchor {
  margin-top: 22px;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  gap: var(--divider-sep);
  position: relative;
}

/* Градиентная линия сверху: прозрачно → синий в центре → прозрачно */
.hero-anchor::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(20, 38, 95, 0) 0%,
    rgba(20, 38, 95, 0.40) 50%,
    rgba(20, 38, 95, 0) 100%
  );
  pointer-events: none;
}

.hero-anchor-line {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hero-anchor-line + .hero-anchor-line {
  margin-top: 2px;
}

/* -----------------------------------------------------------
  Hero anchor: поочерёдное появление строк (1 раз, после загрузки)
  Важно: только если JS включён и нет prefers-reduced-motion.
----------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-anchor {
    perspective: 900px;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateZ(-18px);
    will-change: opacity, transform;
  }

  html.js .hero-anchor .hero-anchor-line {
    opacity: 0;
    transform: translateZ(-26px) scale(0.98);
    will-change: opacity, transform;
  }

  html.js.is-ready .hero-anchor .hero-anchor-line {
    animation: hero-anchor-line 900ms ease forwards;
  }

  html.js.is-ready .hero-anchor .hero-anchor-line:nth-child(1) {
    animation-delay: var(--hero-anchor-delay-1);
  }

  html.js.is-ready .hero-anchor .hero-anchor-line:nth-child(2) {
    animation-delay: calc(var(--hero-anchor-delay-1) + var(--hero-anchor-delay-step) * 1);
  }

  html.js.is-ready .hero-anchor .hero-anchor-line:nth-child(3) {
    animation-delay: calc(var(--hero-anchor-delay-1) + var(--hero-anchor-delay-step) * 2);
  }

  html.js.is-ready .hero-anchor {
    animation: hero-anchor-wrap 900ms ease forwards;
    animation-delay: 0ms;
  }

  @keyframes hero-anchor-line {
    from {
      opacity: 0;
      transform: translateZ(-26px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateZ(0) scale(1);
    }
  }

  @keyframes hero-anchor-wrap {
    from {
      opacity: 0;
      transform: translateZ(-18px);
    }
    to {
      opacity: 1;
      transform: translateZ(0);
    }
  }
}

/* Фото */
.hero-media {
  flex: 0 0 auto;
}

.hero-photo {
  width: 240px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

/* -----------------------------------------------------------
  Button — благородная, плотная, с мягким градиентом
----------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 11px 16px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
}

.button-primary {
  border-color: rgba(20, 38, 95, 0.22);
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(20, 38, 95, 0.92) 0%,
    rgba(20, 38, 95, 0.78) 55%,
    rgba(20, 38, 95, 0.92) 100%
  );
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.button:focus-visible {
  outline: 3px solid rgba(20, 38, 95, 0.22);
  outline-offset: 2px;
}

/* Hover только там, где он реально есть */
@media (hover: hover) {
  .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    border-color: rgba(20, 38, 95, 0.28);
  }

  .button-primary:hover {
    background: linear-gradient(
      135deg,
      rgba(20, 38, 95, 0.98) 0%,
      rgba(20, 38, 95, 0.84) 55%,
      rgba(20, 38, 95, 0.98) 100%
    );
  }
}


.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.service-card {
  flex: 1 1 260px;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 10px 22px rgba(18, 24, 38, 0.04);
}

.card-title {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.card-text {
  margin: 0;
  color: var(--muted);
}

.workflow {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.workflow-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.bullet-list {
  margin: 0 0 10px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.bullet-item {
  margin: 0;
}

.contact-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 14px 22px;
  align-items: center;
}

.contact-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.contact-icon {
  width: 22px;
  color: var(--primary);
}

.contact-channel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 3px;
  color: var(--primary);
  position: relative;
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-label {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
}

.contact-value {
  display: none;
}

.contact-channel::after,
.contact-channel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* Нижний пунктирный бордер (по умолчанию) */
.contact-channel::after {
  opacity: 1;
  background: repeating-linear-gradient(
    to right,
    rgba(30, 58, 138, 0.7) 0 3px,
    transparent 3px 6px
  );
}

/* Нижний сплошной бордер (появляется на hover) */
.contact-channel::before {
  opacity: 0;
  background: rgba(30, 58, 138, 0.85);
}

.page-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Доступность: видимый фокус */
:focus-visible {
  outline: 3px solid rgba(30, 58, 138, 0.35);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Hover-эффекты только на устройствах с hover */
@media (hover:hover) {
  .page-header:hover {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  }

  .nav-link:hover {
    background: rgba(18, 24, 38, 0.06);
    color: var(--text);
  }

  .nav-link:hover::after {
    transform: scaleX(1);
  }

  .lang-switch-button:not(.is-active):hover {
    background: rgba(18, 24, 38, 0.06);
  }

  .button-primary:hover {
    filter: brightness(1.03);
  }

  .contact-channel:hover::after {
    opacity: 0;
  }

  .contact-channel:hover::before {
    opacity: 1;
  }

  .micro-card:hover::after {
    transform: scaleX(1);
  }

  .chip:hover {
    border-color: var(--primary);
    background: #daf6fb40;
    color: var(--primary);
  }

  .chip:hover .chip-icon {
    color: var(--primary);
  }
}

/* -----------------------------------------------------------
  Reveal: тихая анимация появления секций (без шума)
----------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms ease, transform 420ms ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -----------------------------------------------------------------------------
  Адаптив: основной механизм — класс .mobile на body (ставится JS при <= 768px)
----------------------------------------------------------------------------- */

body.mobile .header-inner {
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 0;
}

body.mobile .header-nav {
  width: 100%;
  justify-content: space-between;
}

body.mobile .hero-layout {
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/*body.mobile .hero-photo {
   width: 100%;
}*/

/* На случай, если класс mobile будет поставлен на html */
html.mobile .hero-layout {
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/*html.mobile .hero-photo {
   width: 100%; 
}*/

body.mobile .cards {
  flex-direction: column;
}

body.mobile .service-card {
  min-width: 100%;
}

body.mobile .contact-item {
  flex-wrap: wrap;
}

/* RTL: точечные правки (направление задаётся на html через JS) */
html[dir="rtl"] .workflow-list {
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .bullet-list {
  padding-left: 0;
  padding-right: 20px;
}


