@layer reset, base, components, responsive;

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

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
  }

  body,
  h1,
  p,
  ul {
    margin: 0;
  }

  body {
    min-width: 320px;
  }

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

  button {
    color: inherit;
    font: inherit;
  }
}

@layer base {
  :root {
    color-scheme: dark;
    --bg: oklch(0.075 0.012 190);
    --surface: oklch(0.125 0.018 190);
    --ink: oklch(0.97 0.006 190);
    --muted: oklch(0.75 0.018 190);
    --primary: oklch(0.72 0.145 187);
    --primary-deep: oklch(0.56 0.125 187);
    --accent: #00b7c5;
    --line: oklch(0.55 0.025 190 / 0.42);
    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Golos Text", system-ui, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --header-height: 112px;
    --page-gutter: clamp(28px, 3.25vw, 88px);
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 64px;
    --z-header: 40;
    --z-preloader: 50;
  }

  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body.is-loading {
    overflow: hidden;
  }

  :focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 5px;
  }
}

@layer components {
  .preloader {
    align-items: center;
    animation: preloader-failsafe 0.6s 6.2s var(--ease-out) forwards;
    background: oklch(0.055 0 0);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    will-change: transform;
    z-index: var(--z-preloader);
  }

  .preloader[hidden] {
    display: none;
  }

  .preloader__content {
    width: min(680px, calc(100vw - 48px));
  }

  .preloader__title {
    font-family: var(--display);
    font-size: clamp(2.35rem, 4vw, 4.25rem);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    text-transform: uppercase;
  }

  .preloader__logo {
    display: flex;
    justify-content: center;
  }

  .preloader__logo img {
    height: auto;
    mix-blend-mode: screen;
    width: min(220px, 56vw);
  }

  .preloader__track {
    background: oklch(0.3 0 0);
    height: 2px;
    margin-top: var(--space-md);
    overflow: hidden;
    width: 100%;
  }

  .preloader__bar {
    background: var(--accent);
    display: block;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    width: 100%;
  }

  .preloader__meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    letter-spacing: 0.06em;
    margin-top: var(--space-sm);
    text-transform: uppercase;
  }

  .preloader__counter {
    color: var(--ink);
    font-family: var(--display);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 4ch;
    text-align: right;
  }

  .hero {
    isolation: isolate;
    min-height: max(720px, 100svh);
    overflow: hidden;
    position: relative;
  }

  .hero__media,
  .hero__shade {
    inset: 0;
    position: absolute;
  }

  .hero__media {
    z-index: -3;
  }

  .hero__media picture {
    display: block;
    height: 100%;
    width: 100%;
  }

  .hero__media img {
    height: 100%;
    object-fit: cover;
    object-position: center center;
    width: 100%;
  }

  .hero__shade {
    background:
      linear-gradient(90deg, oklch(0.025 0 0 / 0.98) 0%, oklch(0.025 0 0 / 0.93) 27%, oklch(0.025 0 0 / 0.67) 47%, oklch(0.025 0 0 / 0.08) 72%),
      linear-gradient(180deg, oklch(0.02 0 0 / 0.64) 0%, transparent 30%, transparent 76%, oklch(0.02 0 0 / 0.45) 100%);
    z-index: -2;
  }

  .site-header {
    align-items: center;
    background: oklch(0.025 0.004 190 / 0.96);
    border-bottom: 1px solid oklch(0.44 0.02 190 / 0.24);
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr auto 1fr;
    height: var(--header-height);
    inset: 0 0 auto;
    padding-inline: var(--page-gutter);
    position: fixed;
    width: 100%;
    z-index: var(--z-header);
  }

  .brand {
    align-items: center;
    display: flex;
    font-family: var(--display);
    font-size: clamp(1.2rem, 1.3vw, 1.55rem);
    font-style: normal;
    font-weight: 800;
    justify-self: start;
    letter-spacing: 0.015em;
    text-transform: uppercase;
    width: max-content;
  }

  .brand__logo {
    height: auto;
    mix-blend-mode: screen;
    width: clamp(130px, 9vw, 170px);
  }

  .site-nav {
    align-items: center;
    display: flex;
    gap: clamp(24px, 2.5vw, 46px);
    justify-content: center;
  }

  .header-messengers {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-self: end;
  }

  .header-messengers a {
    align-items: center;
    border: 1px solid oklch(0.7 0.02 190 / 0.36);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    transition: border-color 180ms ease, background-color 180ms ease;
    width: 40px;
    box-shadow: none;
    filter: none;
  }

  .header-messengers a:hover {
    background: transparent;
    border-color: var(--accent);
    box-shadow: none;
    filter: none;
  }

  .header-messengers svg {
    fill: var(--accent);
    height: 19px;
    width: 19px;
  }

  .header-messengers .max-logo {
    height: 20px;
    width: 20px;
  }

  .site-nav__link {
    color: oklch(0.88 0.005 50);
    font-size: 15px;
    font-weight: 500;
    padding-block: 12px;
    position: relative;
    transition: color 180ms ease;
    white-space: nowrap;
  }

  .site-nav__link::after {
    background: var(--accent);
    bottom: 5px;
    content: "";
    height: 2px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 240ms var(--ease-out);
    width: 100%;
  }

  .site-nav__link:hover,
  .site-nav__link.is-current {
    color: var(--ink);
  }

  .site-nav__link:hover::after,
  .site-nav__link.is-current::after {
    transform: scaleX(1);
    transform-origin: left;
  }


  .menu-toggle {
    background: none;
    border: 0;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 6px;
    height: 44px;
    justify-content: center;
    padding: 11px 8px;
    width: 46px;
  }

  .menu-toggle span {
    background: var(--ink);
    display: block;
    height: 2px;
    margin: 0;
    transition: opacity 160ms ease, transform 220ms var(--ease-out);
    width: 30px;
  }

  .hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: max(720px, 100svh);
    padding: calc(var(--space-xl) + var(--header-height)) var(--page-gutter) var(--space-xl);
    position: relative;
    z-index: 2;
  }

  .hero h1 {
    font-family: var(--display);
    font-size: clamp(4rem, 6vw, 6rem);
    font-style: italic;
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 0.9;
    max-width: 880px;
    text-transform: uppercase;
    text-wrap: balance;
  }

  .hero h1 span {
    display: block;
  }

  .hero__lead {
    color: oklch(0.93 0.005 50);
    font-size: clamp(1.05rem, 1.45vw, 1.35rem);
    line-height: 1.5;
    margin-top: var(--space-md);
    text-wrap: pretty;
  }

  .hero__signal {
    background: linear-gradient(90deg, var(--accent), var(--primary-deep));
    height: 3px;
    margin-block: var(--space-md) var(--space-lg);
    transform: skewX(-20deg);
    width: 62px;
  }

  .benefits {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    width: min(690px, 100%);
  }

  .benefit {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
    padding-inline: 24px;
    width: 33.333%;
  }

  .benefit:first-child {
    padding-left: 0;
  }

  .benefit + .benefit {
    position: relative;
  }

  .benefit + .benefit::before {
    background: var(--line);
    content: "";
    height: 36px;
    left: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
  }

  .benefit svg {
    fill: none;
    flex: 0 0 auto;
    height: 34px;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 34px;
  }

  .benefit > span {
    display: grid;
    gap: 4px;
  }

  .benefit strong {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
  }

  .benefit small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
  }

  .hero__actions {
    align-items: center;
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
  }

  .cta {
    align-items: center;
    background: var(--accent);
    clip-path: polygon(7% 0, 100% 0, 92% 100%, 0 100%);
    display: flex;
    font-family: var(--display);
    font-size: 19px;
    font-style: italic;
    font-weight: 700;
    gap: 36px;
    justify-content: center;
    letter-spacing: 0.025em;
    min-height: 58px;
    padding: 0 37px 0 44px;
    text-transform: uppercase;
    transition: filter 180ms ease, transform 180ms var(--ease-out);
  }

  .cta svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 180ms var(--ease-out);
    width: 22px;
  }

  .cta:hover {
    filter: brightness(1.14);
    transform: translateY(-2px);
  }

  .cta:hover svg {
    transform: translateX(4px);
  }

  .action-contact {
    display: grid;
    gap: var(--space-xs);
    line-height: 1.2;
  }

  .action-contact strong {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .action-contact small {
    color: var(--muted);
    font-size: 13px;
  }

  .hero__status {
    background: var(--surface);
    bottom: 24px;
    color: var(--ink);
    font-size: 13px;
    left: 50%;
    max-width: calc(100% - 32px);
    opacity: 0;
    padding: 10px 14px;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 240ms var(--ease-out);
    z-index: 30;
  }

  .hero__status.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  @keyframes preloader-failsafe {
    to {
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }
  }
}

@layer responsive {
  @media (min-width: 1261px) and (max-width: 2200px) {
    .hero h1 {
      font-size: clamp(4.25rem, 4.4vw, 5.25rem);
      max-width: 800px;
    }

    .hero__lead {
      margin-top: 18px;
    }

    .hero__signal {
      margin-block: 18px 32px;
    }

    .benefits {
      width: max-content;
    }

    .benefit {
      padding-inline: 20px;
      width: auto;
    }

    .benefit svg {
      height: 31px;
      width: 31px;
    }

    .hero__actions {
      gap: 20px;
      margin-top: 36px;
    }
  }

  @media (max-width: 1260px) {
    .site-header {
      gap: 28px;
    }

    .site-nav {
      gap: 22px;
    }

    .hero h1 {
      font-size: clamp(3.4rem, 6.2vw, 5rem);
      max-width: 650px;
    }
  }

  @media (max-width: 1020px) {
    :root {
      --header-height: 96px;
    }

    .site-header {
      gap: 12px;
      grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .header-messengers {
      align-items: center;
      display: flex;
      gap: 6px;
      justify-self: end;
    }

    .header-messengers a {
      align-items: center;
      border: 1px solid oklch(0.7 0.02 190 / 0.36);
      display: inline-flex;
      height: 36px;
      justify-content: center;
      transition: border-color 180ms ease, background-color 180ms ease;
      width: 36px;
    }

    .header-messengers svg {
      fill: var(--accent);
      height: 18px;
      width: 18px;
    }

    .menu-toggle {
      display: flex;
      grid-column: 3;
      grid-row: 1;
      position: relative;
      z-index: 2;
    }

    .site-nav {
      align-items: stretch;
      background: oklch(0.09 0 0 / 0.98);
      clip-path: inset(0 0 0 100%);
      display: flex;
      flex-direction: column;
      gap: 0;
      inset: 0 0 auto auto;
      min-height: 100svh;
      opacity: 0;
      padding: 112px 34px 32px;
      pointer-events: none;
      position: fixed;
      transition:
        clip-path 360ms var(--ease-out),
        opacity 240ms ease,
        visibility 0s linear 360ms;
      visibility: hidden;
      width: min(360px, 88vw);
      z-index: 1;
    }

    .site-nav.is-open {
      clip-path: inset(0);
      opacity: 1;
      pointer-events: auto;
      transition-delay: 0s;
      visibility: visible;
    }

    .site-nav__link {
      border-bottom: 1px solid var(--line);
      font-family: var(--display);
      font-size: 27px;
      font-style: italic;
      font-weight: 700;
      padding-block: 15px;
      text-transform: uppercase;
    }

    .site-nav__link::after {
      display: none;
    }

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

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
      opacity: 0;
    }

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

    .hero__shade {
      background:
        linear-gradient(90deg, oklch(0.025 0 0 / 0.97) 0%, oklch(0.025 0 0 / 0.88) 40%, oklch(0.025 0 0 / 0.28) 80%),
        linear-gradient(180deg, oklch(0.02 0 0 / 0.5), transparent 45%, oklch(0.02 0 0 / 0.42));
    }
  }

  @media (max-width: 700px), (min-width: 701px) and (max-width: 1024px) and (orientation: portrait) {
    .hero {
      min-height: max(660px, 100svh);
    }

    .hero__media img {
      object-position: center center;
    }

    .hero__shade {
      background: none;
    }

    .hero__content {
      display: grid;
      grid-template-rows: auto auto auto minmax(210px, 1fr) auto auto;
      justify-content: stretch;
      min-height: max(660px, 100svh);
      padding: calc(28px + var(--header-height)) 20px 26px;
    }

    .hero__content > h1 {
      grid-row: 1;
    }

    .hero h1 {
      font-size: clamp(1.95rem, 8.6vw, 2.5rem);
      line-height: 0.88;
      max-width: 100%;
      text-wrap: initial;
    }

    .hero h1 span {
      width: min-content;
    }

    .hero__lead {
      grid-row: 2;
      font-size: 1rem;
      line-height: 1.42;
      margin-top: 16px;
      max-width: 350px;
    }

    .hero__signal {
      grid-row: 3;
      margin-block: 18px 0;
      width: 64px;
    }

    .benefits {
      align-items: stretch;
      display: grid;
      grid-row: 5;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin: 0;
      max-width: 100%;
      overflow: clip;
      width: 100%;
    }

    .benefit {
      align-items: center;
      flex-direction: column;
      gap: 10px;
      justify-content: center;
      min-height: 112px;
      padding: 0 12px;
      text-align: center;
      width: auto;
    }

    .benefit:first-child {
      padding-left: 12px;
    }

    .benefit + .benefit::before {
      height: 84px;
    }

    .benefit svg {
      height: 34px;
      width: 34px;
    }

    .benefit > span {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
    }

    .benefit strong,
    .benefit small {
      font-size: clamp(0.66rem, 2.7vw, 0.78rem);
      line-height: 1.25;
      overflow-wrap: break-word;
    }

    .hero__actions {
      align-items: center;
      flex-direction: column;
      gap: 18px;
      grid-row: 6;
      margin-top: 20px;
      width: 100%;
    }

    .cta {
      align-self: center;
      background: var(--accent);
      border: 0;
      clip-path: polygon(7% 0, 100% 0, 92% 100%, 0 100%);
      color: var(--ink);
      font-size: 19px;
      font-style: italic;
      justify-content: center;
      letter-spacing: 0.025em;
      min-height: 58px;
      padding: 0 37px 0 44px;
      width: min(100%, 350px);
    }

    .cta svg {
      color: currentColor;
    }

    .action-contact {
      display: none;
    }

  }

  @media (min-width: 701px) and (max-width: 1024px) and (orientation: portrait) {
    .hero__media img {
      object-position: center 62%;
    }

    .hero__content {
      grid-template-rows: auto auto auto minmax(330px, 1fr) auto auto;
      padding: calc(36px + var(--header-height)) clamp(36px, 5vw, 54px) 36px;
    }

    .hero h1 {
      font-size: clamp(3.35rem, 7vw, 4.45rem);
    }

    .hero__lead {
      font-size: 1.15rem;
      margin-top: 20px;
      max-width: 480px;
    }

    .hero__signal {
      margin-top: 22px;
      width: 78px;
    }

    .benefit {
      gap: 14px;
      min-height: 132px;
      padding-inline: 28px;
    }

    .benefit:first-child {
      padding-left: 28px;
    }

    .benefit + .benefit::before {
      height: 98px;
    }

    .benefit svg {
      height: 42px;
      width: 42px;
    }

    .benefit strong,
    .benefit small {
      font-size: 0.98rem;
    }

    .hero__actions {
      margin-top: 26px;
    }

    .cta {
      font-size: 1.35rem;
      min-height: 72px;
      padding-inline: 32px;
    }
  }

  @media (max-width: 700px) {
    :root {
      --header-height: 86px;
    }

    .site-header {
      padding-inline: 20px;
    }

    .brand {
      font-size: 1.2rem;
    }

    .brand__logo {
      width: 112px;
    }
  }

  @media (min-width: 371px) and (max-width: 379px) and (max-height: 700px) {
    .hero__media img {
      object-position: center 56%;
    }
  }

  @media (min-width: 500px) and (max-width: 600px) and (max-height: 800px) and (orientation: portrait) {
    .hero__content {
      grid-template-rows: auto auto auto minmax(250px, 1fr) auto;
      padding-bottom: 24px;
    }

    .hero__actions {
      display: none;
    }
  }

  @media (min-width: 960px) and (max-width: 1100px) and (max-height: 650px) and (orientation: landscape) {
    .hero__content {
      justify-content: flex-start;
      padding: calc(var(--header-height) + 38px) 48px 28px;
    }

    .hero h1 {
      font-size: 3rem;
      max-width: 540px;
    }

    .hero__lead {
      font-size: 0.95rem;
      margin-top: 14px;
    }

    .hero__signal {
      margin-block: 14px 22px;
    }

    .benefits {
      width: 520px;
    }

    .benefit {
      padding-inline: 16px;
    }

    .hero__actions {
      gap: 18px;
      margin-top: 26px;
    }

    .cta {
      min-height: 52px;
    }

    .action-contact strong {
      font-size: 17px;
    }

    .action-contact small {
      font-size: 11px;
    }
  }

  @media (max-width: 380px) {
    .site-header {
      gap: 8px;
      padding-inline: 16px;
    }

    .brand__logo {
      width: 96px;
    }

    .header-messengers {
      gap: 4px;
    }

    .header-messengers a {
      height: 32px;
      width: 32px;
    }

    .header-messengers svg {
      height: 16px;
      width: 16px;
    }

    .menu-toggle {
      height: 36px;
      width: 36px;
    }

    .hero__content {
      grid-template-rows: auto auto auto minmax(180px, 1fr) auto auto;
      padding-bottom: 20px;
      padding-inline: 16px;
    }

    .benefit {
      min-height: 104px;
      padding-inline: 8px;
    }

    .benefit:first-child {
      padding-left: 8px;
    }

    .benefit + .benefit::before {
      height: 76px;
    }
  }

  @media (max-width: 410px) {
    .benefit {
      align-items: center;
      flex-direction: column;
      gap: 9px;
    }

    .benefit svg {
      height: 29px;
      width: 29px;
    }

    .benefit strong,
    .benefit small {
      font-size: clamp(10px, 2.9vw, 12px);
    }

    .benefit > span {
      min-width: 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .preloader {
      animation-delay: 0.15s !important;
    }

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