/* ==========================================================================
   Page Proofs — main stylesheet
   Mobile-first: базовые стили для телефонов, далее min-width брейкпоинты
   640px (большие телефоны / планшеты), 960px (планшеты / ноутбуки), 1200px (десктоп)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper: #F3F2ED;
  --paper-2: #E9E7DF;
  --ink: #121210;
  --ink-2: #3A3934;
  --muted: #5A5952;
  --muted-dark: #A9A8A0;
  --line: #D9D7CE;
  --line-strong: #8B8A82;
  --accent: #C8231B;
  --accent-ink: #A61C15;
  --error: #B3261E;
  --success: #1E6B4E;

  --font-display: 'Geologica', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Onest', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: 20px;
  --container: 1320px;
  --header-h: 64px;
  --section-y: 80px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur: .8s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  border-radius: 8px; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}
.section { padding-block: var(--section-y); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--tint { background: var(--paper-2); border-top: 1px solid var(--line); }

.section__head {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 40px;
}
.section__title { margin-bottom: 40px; }
.section__lead { max-width: 440px; font-size: 16px; color: var(--muted); }

/* ---------- Typography ---------- */
.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 8.5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--accent { color: var(--accent-ink); }
.eyebrow--muted { color: var(--muted-dark); }
.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 500; font-size: 16px; line-height: 1.2;
  white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease-out);
}
.btn:active { transform: scale(.98); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-ink); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #2A2925; }
.btn--outline { border-color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- Crop marks (метки обреза) ---------- */
.proof { position: relative; }
.cm {
  position: absolute; width: 14px; height: 14px;
  border: 0 solid currentColor; pointer-events: none;
}
.cm--tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.cm--tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.cm--bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.cm--br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
/* Размытие фона вынесено в псевдоэлемент: backdrop-filter на самом header
   сделал бы его контейнером для position:fixed и обрезал мобильное меню */
.header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(243, 242, 237, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header__inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.logo__dot { fill: var(--accent); }
.logo__text { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }

/* Burger (mobile) */
.burger {
  position: relative; z-index: 2;
  width: 44px; height: 44px; margin-right: -10px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: none; border: 0;
}
.burger__line {
  width: 24px; height: 1.5px; background: var(--ink);
  transition: transform .35s var(--ease-out);
}
.burger[aria-expanded="true"] .burger__line:first-child { transform: translateY(4.25px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:last-child { transform: translateY(-4.25px) rotate(-45deg); }

/* Mobile nav panel */
.nav {
  position: fixed; inset: 0; z-index: 1;
  padding: calc(var(--header-h) + 32px) var(--gutter) 40px;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  visibility: hidden; opacity: 0;
  transform: translateY(-12px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), visibility 0s .35s;
}
.nav.is-open {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), visibility 0s;
}
.nav__list { display: flex; flex-direction: column; }
.nav__link {
  display: block; padding: 14px 0;
  font-family: var(--font-display); font-size: 34px; font-weight: 400; letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.nav__cta { width: 100%; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 48px 0 64px; }
.hero__meta {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 28px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.hero__meta .accent { color: var(--accent-ink); }
.hero__proof { padding: 28px 0 32px; }
.hero__title {
  padding-inline: 14px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 11.5vw, 120px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.hero__title b { font-weight: 500; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line__in { display: inline-block; }
.hero__bottom { display: flex; flex-direction: column; gap: 28px; margin-top: 32px; }
.hero__lead { font-size: 17px; color: var(--ink-2); max-width: 580px; }
.hero__actions { display: flex; flex-direction: column; gap: 12px; }
.hero__actions .btn { width: 100%; }

/* ==========================================================================
   Clients
   ========================================================================== */
.clients { border-block: 1px solid var(--line); }
.clients__inner {
  padding-block: 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  font-family: var(--font-display); font-size: 17px; color: var(--ink-2);
}
.clients__inner .eyebrow { flex-basis: 100%; }
.clients__item--leicht { font-weight: 600; letter-spacing: .18em; }
.clients__item--poliform { font-weight: 500; letter-spacing: .06em; }
.clients__item--bold { font-weight: 600; }

/* ==========================================================================
   Services
   ========================================================================== */
.services {
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid var(--ink);
}
.service {
  display: flex; flex-direction: column; gap: 12px;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--line);
}
.service__num { font-family: var(--font-mono); font-size: 13px; color: var(--accent-ink); }
.service__title { font-family: var(--font-display); font-weight: 500; font-size: 24px; letter-spacing: -0.015em; }
.service__text { color: var(--ink-2); }

/* ==========================================================================
   Works
   ========================================================================== */
.works { display: grid; grid-template-columns: 1fr; gap: 32px; }
.work { display: flex; flex-direction: column; gap: 16px; color: var(--paper); }
.work__cover {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper);
}
.work__cover::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.06);
  opacity: 0; transition: opacity .4s;
}
.work__logo {
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 50px);
  letter-spacing: -0.02em;
  transition: transform .7s var(--ease-out);
}
.work:hover .work__logo, .work:focus-visible .work__logo { transform: scale(1.05); }
.work:hover .work__cover::after { opacity: 1; }
.work__logo--leicht { font-weight: 600; letter-spacing: .32em; padding-left: .32em; }
.work__logo--poliform { font-weight: 300; letter-spacing: .04em; }
.work__logo--stack { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 400; line-height: 1.05; }
.work__logo--stack b { font-weight: 500; }
.work__logo--stack .wide { font-weight: 600; letter-spacing: .06em; }
.work__logo--stack small {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; opacity: .85;
}

.work__cover--leicht { background: #E7E3DA; color: var(--ink); }
.work__cover--poliform { background: #2A2925; }
.work__cover--ki { background: #6B6355; }
.work__cover--avgusta { background: #7A2E22; }
.work__cover--gumbeat { background: #1F2A44; }
.work__cover--mp { background: #23443A; }

.work__info {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 16px; border-bottom: 1px solid #3A3934;
  transition: border-color .3s;
}
.work:hover .work__info { border-bottom-color: var(--paper); }
.work__title { font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.work__desc { font-size: 15px; color: var(--muted-dark); margin-top: 2px; }
.work__url { font-family: var(--font-mono); font-size: 12px; color: var(--muted-dark); white-space: nowrap; padding-top: 6px; }

/* ==========================================================================
   Process
   ========================================================================== */
.steps { display: grid; grid-template-columns: 1fr; gap: 32px; }
.step { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--ink); }
.step--accent { border-top-color: var(--accent); }
.step__num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.step--accent .step__num { color: var(--accent-ink); }
.step__title { font-family: var(--font-display); font-weight: 500; font-size: 21px; }
.step__text { color: var(--ink-2); }

/* ==========================================================================
   Contact & Form
   ========================================================================== */
.contact { display: flex; flex-direction: column; gap: 40px; }
.contact__intro { display: flex; flex-direction: column; gap: 18px; }
.contact__list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: 17px; }
.contact__list a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.contact__list a:hover { border-bottom-color: currentColor; }

.contact__card { background: var(--paper); padding: 28px 20px; }

.form { display: flex; flex-direction: column; gap: 24px; }
.form__legend { font-size: 14px; color: var(--muted); margin-bottom: 12px; padding: 0; }
.form__grid { display: grid; grid-template-columns: 1fr; gap: 20px 32px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  font-size: 15px; cursor: pointer; user-select: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 2px; }
.field__label { font-size: 14px; color: var(--muted); }
.req { color: var(--accent-ink); }
.field__input {
  width: 100%;
  padding: 12px 0;
  font-size: 16px; /* 16px — без автозума в iOS */
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { color: #7A7970; }
.field__input:focus { border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.field__input--area { resize: vertical; min-height: 104px; }
.field.has-error .field__input { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field__error { min-height: 0; font-size: 13px; color: var(--error); }
.field__error:empty { display: none; }

.select { position: relative; }
.select::after {
  content: ''; position: absolute; right: 4px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg); pointer-events: none;
}
.select select { padding-right: 28px; cursor: pointer; }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.check a { text-decoration: underline; text-underline-offset: 2px; }
.field--check.has-error .check { color: var(--error); }

.form__footer { display: flex; flex-direction: column; gap: 20px; }
.form__submit { width: 100%; position: relative; }
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.form.is-loading .spinner { display: inline-block; }
.form.is-loading .form__submit { pointer-events: none; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form__status { font-size: 14px; color: var(--error); }
.form__status:empty { display: none; }

/* Honeypot */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Success */
.success {
  min-height: 420px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px;
  outline: none;
}
.success[hidden] { display: none; }
.success__circle, .success__tick { stroke: var(--accent); }
.success__circle { stroke-dasharray: 164; stroke-dashoffset: 164; }
.success__tick { stroke-dasharray: 36; stroke-dashoffset: 36; }
.success.is-visible .success__circle { animation: draw .7s var(--ease-out) forwards; }
.success.is-visible .success__tick { animation: draw .45s var(--ease-out) .5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success__title { font-family: var(--font-display); font-weight: 400; font-size: 32px; letter-spacing: -0.02em; }
.success__text { font-size: 17px; color: var(--ink-2); max-width: 440px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--ink); color: var(--muted-dark); }
.footer__inner {
  padding-block: 40px calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; font-size: 14px;
}
.footer__brand { font-family: var(--font-display); font-weight: 500; font-size: 18px; color: var(--paper); }

/* ==========================================================================
   Reveal animations (только если JS включён)
   ========================================================================== */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-revealed { opacity: 1; transform: none; will-change: auto; }

/* Заголовок hero: строки выезжают снизу */
.js .hero__title .line__in {
  transform: translate3d(0, 105%, 0);
  transition: transform 1.1s var(--ease-out);
}
.js .hero__title .line:nth-child(2) .line__in { transition-delay: .12s; }
.js .hero__proof.is-revealed .line__in { transform: none; }

/* Метки обреза «прорисовываются» */
.js .proof .cm { opacity: 0; transform: scale(.4); transition: opacity .6s var(--ease-out) .3s, transform .6s var(--ease-out) .3s; }
.js .proof.is-revealed .cm { opacity: 1; transform: none; }
.cm--tl { transform-origin: top left; } .cm--tr { transform-origin: top right; }
.cm--bl { transform-origin: bottom left; } .cm--br { transform-origin: bottom right; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal], .js .hero__title .line__in, .js .proof .cm { opacity: 1; transform: none; }
  .success__circle, .success__tick { stroke-dashoffset: 0; }
}

/* ==========================================================================
   ≥ 640px
   ========================================================================== */
@media (min-width: 640px) {
  :root { --gutter: 32px; --section-y: 100px; }

  .hero { padding: 72px 0 80px; }
  .hero__meta { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 36px; }
  .hero__title { padding-inline: 28px; }
  .hero__actions { flex-direction: row; flex-wrap: wrap; }
  .hero__actions .btn { width: auto; }

  .clients__inner .eyebrow { flex-basis: auto; }

  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }

  .contact__card { padding: 40px; }
  .form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form__footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .form__footer .field--check { max-width: 380px; }
  .form__submit { width: auto; min-width: 240px; }

  .footer__inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
}

/* ==========================================================================
   ≥ 960px
   ========================================================================== */
@media (min-width: 960px) {
  :root { --header-h: 76px; --section-y: 120px; }

  /* Десктопное меню */
  .burger { display: none; }
  .nav {
    position: static; inset: auto; padding: 0;
    flex-direction: row; align-items: center; gap: 32px;
    background: none; visibility: visible; opacity: 1; transform: none; transition: none;
  }
  .nav__list { flex-direction: row; gap: 28px; }
  .nav__link {
    padding: 6px 0; border: 0;
    font-family: var(--font-body); font-size: 15px; letter-spacing: 0;
    position: relative;
  }
  .nav__link::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: right;
    transition: transform .35s var(--ease-out);
  }
  .nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
  .nav__cta { width: auto; min-height: 44px; padding: 10px 20px; font-size: 15px; }

  .hero { padding: 96px 0 96px; }
  .hero__proof { padding: 44px 0 52px; }
  .hero__title { padding-inline: 40px; }
  .hero__bottom { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 48px; margin-top: 48px; }
  .hero__lead { font-size: 20px; }
  .hero__actions { flex-wrap: nowrap; }

  .clients__inner { justify-content: space-between; padding-block: 28px; font-size: 20px; }

  .section__head { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 56px; }
  .section__title { margin-bottom: 56px; }
  .section__lead { font-size: 17px; }

  .services { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .service { padding: 32px 0 40px; }
  .service__title { font-size: 26px; }

  .works { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work__cover { aspect-ratio: 5 / 4; }
  .work__logo { font-size: clamp(34px, 3.3vw, 50px); }
  .work__title { font-size: 22px; }

  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .contact { flex-direction: row; gap: 64px; }
  .contact__intro { flex: 1 1 0; position: sticky; top: calc(var(--header-h) + 40px); align-self: flex-start; }
  .contact__card { flex: 1.7 1 0; min-width: 0; padding: 48px; }
  .success__title { font-size: 36px; }
}

/* ==========================================================================
   ≥ 1200px
   ========================================================================== */
@media (min-width: 1200px) {
  .hero__title { font-size: clamp(88px, 8vw, 124px); }
  .work__info { align-items: baseline; }
}

/* Hover только на устройствах с указателем */
@media (hover: none) {
  .work:hover .work__logo { transform: none; }
}
