/* ==========================================================================
   Дизайн-система ООО «ТРЕЛИСА»
   CSS-переменные, шрифты, reset, базовая типографика.
   ========================================================================== */

/* --- Шрифт Inter (self-hosted, OFL) --- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


:root {
  /* ---- Палитра: тёмный лендинг ---- */
  --color-bg:            #0b1220;
  --color-bg-soft:       #111a2d;
  --color-bg-elevated:   #162236;
  --color-surface:       rgba(255, 255, 255, 0.06);
  --color-surface-hover: rgba(255, 255, 255, 0.10);
  --color-border:        rgba(255, 255, 255, 0.12);
  --color-border-strong: rgba(255, 255, 255, 0.22);

  --color-text:          #edf2f7;
  --color-text-muted:    #b9c5d7;
  --color-text-subtle:   #8a9bb4;
  --color-text-on-accent:#ffffff;

  --color-accent:        #23C2DB;
  --color-accent-hover:  #4ED5E8;
  --color-accent-deep:   #0A7DAC;
  --color-accent-soft:   rgba(35, 194, 219, 0.14);
  --color-info:          #23C2DB;
  --color-info-soft:     rgba(35, 194, 219, 0.13);
  --color-success:       #2fbf71;
  --color-danger:        #ef4444;

  /* ---- Светлая палитра (для /privacy и /consent) ---- */
  --legal-bg:            #f5f7fb;
  --legal-surface:       #ffffff;
  --legal-text:          #0f172a;
  --legal-text-muted:    #475569;
  --legal-border:        #e2e8f0;
  --legal-link:          #0A7DAC;

  /* ---- Типографика ---- */
  --font-body:
    "Inter",
    -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu,
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs:  0.8125rem;                                     /* 13 */
  --fs-sm:  0.875rem;                                      /* 14 */
  --fs-md:  1rem;                                          /* 16 */
  --fs-lg:  clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);     /* 17–19 */
  --fs-xl:  clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);        /* 20–24 */
  --fs-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);             /* 24–32 */
  --fs-3xl: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);       /* 30–40 */
  --fs-4xl: clamp(2.25rem, 1.75rem + 2.4vw, 3.5rem);       /* 36–56 */
  --fs-5xl: clamp(2.75rem, 2rem + 3.2vw, 4.5rem);          /* 44–72 (hero h1) */

  --lh-tight: 1.15;
  --lh-snug:  1.3;
  --lh-body:  1.6;
  --lh-loose: 1.75;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* ---- Отступы (4px base) ---- */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* ---- Радиусы ---- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --radius-2xl:  28px;
  --radius-pill: 999px;

  /* ---- Тени ---- */
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md:     0 6px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg:     0 20px 50px rgba(0, 0, 0, 0.28);
  --shadow-xl:     0 30px 80px rgba(0, 0, 0, 0.35);
  --shadow-accent: 0 10px 24px rgba(10, 125, 172, 0.42);

  /* ---- Layout ---- */
  --container-max:     1180px;
  --container-gutter:  24px;
  --nav-height:        72px;

  /* ---- Motion ---- */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    160ms;
  --dur-med:     280ms;
  --dur-slow:    480ms;

  /* ---- Z-index ---- */
  --z-header: 20;
  --z-banner: 50;
  --z-modal:  100;
}

/* ==========================================================================
   Reset + базовая типографика
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

dl, dt, dd {
  margin: 0;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@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;
  }
}

/* ==========================================================================
   Утилиты
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Reveal-on-scroll (используется main.js IntersectionObserver)
   Появление с размытием + смещением + лёгким увеличением.
   Поддерживает стаггер через CSS-переменную --reveal-delay.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(12px);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out),
    filter 900ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  /* will-change удалён из default-state — GPU и так включается во время transition.
     Постоянные composite-layers на 30+ элементах создают лишний memory overhead. */
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Варианты появления */
.reveal--soft      { transform: translateY(16px); filter: blur(8px); }
.reveal--deep      { transform: translateY(56px); filter: blur(18px); }
.reveal--scale     { transform: translateY(24px) scale(0.96); }
.reveal--left      { transform: translateX(-32px); }
.reveal--right     { transform: translateX(32px); }
.reveal--scale.is-visible,
.reveal--left.is-visible,
.reveal--right.is-visible { transform: none; }

/* Ken Burns: мягкий zoom-in после появления (внутри .reveal-image.is-visible) */
.reveal-image {
  overflow: hidden;
}
.reveal-image img,
.reveal-image picture {
  transform: scale(1.08);
  filter: blur(14px);
  transition:
    transform 1600ms var(--ease-out),
    filter 1200ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-image.is-visible img,
.reveal-image.is-visible picture {
  transform: scale(1);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-image img,
  .reveal-image picture {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}
