/* grigorytal.com – главная.
   Идея вёрстки: ровный шрифт – агентам, почерк Гриши – человеку.
   Одна колонка 1160px, крупные блоки, один акцент (оранжевый маркер). */

@font-face {
  font-family: "NT Somic";
  src: url("fonts/NTSomic-VF.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Tal Hand";
  src: url("fonts/TalHand-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #0e1524;        /* тёмно-синий из футболки на фото */
  --soft: #39435a;       /* второй текст: тёмный, не серый */
  --sky: #e9f2fc;        /* небо с фото, разбавленное */
  --sky-line: #cfe0f4;
  --marker: #ff5a24;     /* маркер: почерк, стрелки, схема */
  --marker-deep: #e2410f;
  --on-ink: #d6deee;     /* текст на тёмном */

  --font: "NT Somic", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --hand: "Tal Hand", "Bradley Hand", "Segoe Print", cursive;

  --gutter: 20px;
  --wrap: 1160px;
  --r-card: 26px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
p { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.hand {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--marker);
  line-height: 1;
  letter-spacing: 0.01em;
  font-feature-settings: "calt", "liga";
}

:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ───────── Шапка ───────── */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 14px;
}
.top__name {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 25px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.top__nav {
  display: none;
  gap: 30px;
  font-size: 17px;
  font-weight: 500;
}
.top__nav a { text-decoration: none; }
.top__nav a:hover { color: var(--marker-deep); }
.top__side {
  display: flex;
  align-items: center;
  gap: 6px;
}
.top__lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--sky-line);
}
.top__lang:hover { border-color: var(--ink); }

/* ───────── Кнопки ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 30px;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--marker { background: var(--marker); border-color: var(--marker); color: var(--ink); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
}
.arrow-link::after {
  content: "→";
  transition: transform 0.25s var(--ease);
}
a:hover > .arrow-link::after,
a:hover > div > .arrow-link::after,
.arrow-link:hover::after { transform: translateX(5px); }

/* ───────── Первый экран ───────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 20px;
  padding-bottom: 56px;
}
.hero__photo {
  grid-area: 1 / 1;
  position: relative;
  margin: 0;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #a5c8ee;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero__title {
  grid-area: 1 / 1;
  align-self: start;
  position: relative;
  z-index: 1;
  padding: 22px 22px 0;
  font-size: clamp(33px, 9.7vw, 44px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero__title > span { display: block; }
.mark { position: relative; display: inline-block; white-space: nowrap; }
.mark svg {
  position: absolute;
  left: -3%;
  bottom: -0.16em;
  width: 106%;
  height: 0.26em;
  overflow: visible;
}
.mark path {
  fill: none;
  stroke: var(--marker);
  stroke-width: 6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hero__body { grid-area: 2 / 1; }
.hero__lead {
  font-size: 19px;
  line-height: 1.45;
  max-width: 34em;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: 20px;
}
.hero__cta .btn { flex: 1 1 100%; }
.hero__cta .arrow-link { font-size: 18px; }

/* пометка маркером на фото */
.me {
  position: absolute;
  left: 61%;
  top: 37%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: rotate(-5deg);
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(14, 21, 36, 0.3));
}
.me--two { top: 29%; }
.me__text {
  font-size: clamp(32px, 9vw, 46px);
  line-height: 0.92;
  color: #fff;
  white-space: nowrap;
}
.me__arrow {
  width: clamp(58px, 16vw, 86px);
  height: auto;
  margin: 4px 0 0 -34%;
  overflow: visible;
}
.me__arrow path {
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ───────── Секции ───────── */

.section { padding-block: 60px; }
.section--sky { background: var(--sky); }
.section--ink { background: var(--ink); color: #fff; }

.head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 22px;
  margin-bottom: 28px;
}
.h2 {
  font-size: clamp(36px, 6.4vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.head__note {
  font-size: clamp(28px, 4.2vw, 40px);
  transform: rotate(-3deg);
  transform-origin: left bottom;
  padding-bottom: 4px;
  white-space: nowrap;
}

/* ───────── Команда: схема ───────── */

.org {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org__tree { display: none; }
.org__drop {
  width: 40px;
  height: 56px;
  margin: 8px 0 6px;
  overflow: visible;
}
.org__tree path,
.org__drop path {
  fill: none;
  stroke: var(--marker);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.team {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}
.agent {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 22px 20px;
  border-radius: var(--r-card);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.agent:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(14, 21, 36, 0.35);
}
.agent__role {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.agent__note {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  white-space: nowrap;
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.agent__text {
  margin-top: 12px;
  margin-bottom: 16px;
  font-size: 17px;
  line-height: 1.42;
  color: var(--soft);
}
.agent__go {
  margin-top: auto;
  font-size: 17px;
}

/* карточка «Человек» – верх схемы */
.agent--me {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
  width: 100%;
  height: auto;
  background: var(--ink);
  color: #fff;
}
.agent--me .agent__photo {
  width: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 26%;
  border-radius: 50%;
  background: #2b2c30;
}
/* на телефоне фото и должность стоят в одну строку, пометка и текст – на всю ширину */
.agent__me { display: contents; }
.agent--me .agent__note,
.agent--me .agent__text,
.agent--me .agent__go { grid-column: 1 / -1; }
.agent--me .agent__note { margin-top: 14px; }
.agent--me .agent__text { color: var(--on-ink); }
.agent--me .agent__note { color: #ff7a4d; }

/* ───────── Как сделать так же ───────── */

.doors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.door {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 22px 22px;
  border-radius: var(--r-card);
  background: var(--sky);
}
.door--main { background: var(--ink); color: #fff; }
.door__price { font-size: 18px; font-weight: 600; }
.door__title {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.door__text {
  margin-top: 12px;
  margin-bottom: 22px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--soft);
}
.door--main .door__text { color: var(--on-ink); }
.door .btn { margin-top: auto; width: 100%; }
.door:not(.door--main) .btn { background: transparent; color: var(--ink); }
.door:not(.door--main) .btn:hover { background: var(--ink); color: #fff; }

/* ───────── Сцена ───────── */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.stage__head { margin-bottom: 22px; }
.stage__photo {
  margin: 0 0 22px;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 5 / 4;
  background: #d9d3c6;
}
.stage__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 12%; }
.stage__text { font-size: 19px; max-width: 30em; }
.stages {
  list-style: none;
  margin: 22px 0 26px;
  padding: 0;
  border-top: 1.5px solid var(--sky-line);
}
.stages li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1.5px solid var(--sky-line);
}
.stages b {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stages span { font-size: 18px; color: var(--soft); }
.stages .arrow-link { font-size: 18px; margin-top: 4px; }
.stage__body .btn { width: 100%; }

/* ───────── Где смотреть ───────── */

.watch {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.watch a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
  padding: 20px 0;
  border-bottom: 2px solid var(--ink);
  text-decoration: none;
}
.watch__name {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.watch__what { grid-column: 1; font-size: 18px; color: var(--soft); }
.watch__go {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 34px;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}
.watch a:hover .watch__go { transform: translateX(8px); color: var(--marker-deep); }

/* ───────── Написать ───────── */

.contact .head { margin-bottom: 16px; }
.contact__note { color: #ff7a4d; }
.contact__text { font-size: 19px; color: var(--on-ink); max-width: 26em; }
.contact__grid { display: grid; gap: 28px; }
.contact__ways {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact__ways .btn--ghost { color: #fff; border-color: #56617a; }
.contact__ways .btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1.5px solid #2c3750;
  font-size: 16px;
  color: var(--on-ink);
}
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot__copy { flex: 1 1 100%; }

/* ───────── Планшет ───────── */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  body { font-size: 19px; }
  .top { padding-block: 18px; gap: 16px; }
  .top__name { font-size: 30px; }
  .top__nav { display: flex; }
  .top__side { gap: 8px; }
  .top__lang { min-width: 48px; font-size: 16px; padding: 0 12px; }
  .btn--small { padding: 0 20px; font-size: 16px; }

  .section { padding-block: 92px; }
  .head { margin-bottom: 36px; }
  .hero { justify-items: center; }
  .hero__photo, .hero__title, .hero__body { width: min(100%, 540px); }
  .hero__cta .btn { flex: 0 0 auto; }

  .team, .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .agent { padding: 28px 26px 26px; }
  .agent--me {
    grid-template-columns: 150px minmax(0, 1fr);
    column-gap: 28px;
    max-width: 660px;
  }
  .agent--me .agent__photo { width: 150px; aspect-ratio: 4 / 5; object-position: 50% 22%; border-radius: 16px; }
  .agent__me { display: flex; flex-direction: column; min-width: 0; }
  .agent--me .agent__note { margin-top: 6px; }

  .stage {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 48px;
  }
  .stage__photo { grid-area: 1 / 1 / 3 / 2; margin: 0; aspect-ratio: 4 / 5; }
  .stage__photo img { object-position: 30% 20%; }
  .stage__head { grid-area: 1 / 2; align-self: end; margin-bottom: 20px; }
  .stage__body { grid-area: 2 / 2; align-self: start; }
  .stage__body .btn { width: auto; }

  .contact__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; }
  .contact__ways { min-width: 300px; }
  .foot__copy { flex: 0 1 auto; margin-right: auto; }
}

/* ───────── Ноутбук ───────── */

@media (min-width: 1024px) {
  .top { padding-block: 26px; }
  .top__name { font-size: 34px; }

  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    grid-template-rows: auto auto;
    column-gap: 64px;
    row-gap: 0;
    justify-items: stretch;
    align-items: start;
    padding-top: 18px;
    padding-bottom: 110px;
  }
  .hero__photo {
    grid-area: 1 / 2 / 3 / 3;
    width: 100%;
    border-radius: 36px;
    aspect-ratio: 3 / 4;
    max-height: min(78vh, 700px);
    justify-self: end;
  }
  .hero__photo img { object-position: center top; }
  .hero__title {
    grid-area: 1 / 1;
    align-self: end;
    width: auto;
    padding: 0;
    font-size: clamp(56px, 5.6vw, 82px);
    line-height: 1;
    letter-spacing: -0.045em;
  }
  .hero__body { grid-area: 2 / 1; width: auto; padding-top: 30px; }
  .hero__lead { font-size: 23px; max-width: 25em; }
  .hero__cta { margin-top: 36px; }
  .me { top: 27.5%; }
  .me--two { top: 21%; }
  .me__text { font-size: 54px; }
  .me__arrow { width: 96px; }

  .section { padding-block: 120px; }
  .head { margin-bottom: 48px; }

  .org__drop { display: none; }
  .org__tree { display: block; width: 100%; height: 84px; margin: 4px 0 2px; overflow: visible; }
  .team, .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .agent { padding: 30px 28px 28px; }
  .agent__role { font-size: 32px; }
  .agent__note { font-size: 27px; }
  .agent__text { font-size: 18px; margin-top: 14px; margin-bottom: 20px; }
  .agent__go { font-size: 18px; }
  .agent--me { grid-template-columns: 170px minmax(0, 1fr); padding: 26px 34px 26px 26px; max-width: 700px; }
  .agent--me .agent__photo { width: 170px; }

  .door { padding: 32px 28px 28px; }
  .door__title { font-size: 32px; white-space: nowrap; }
  .door__text { font-size: 18px; }

  .stage { column-gap: 80px; }
  .stage__text { font-size: 21px; }
  .contact__text { font-size: 21px; }
  .contact__ways { min-width: 340px; }
}

/* Появление пометок маркером: один раз при загрузке. Без анимации всё уже на месте. */
@media (prefers-reduced-motion: no-preference) {
  .me__text { animation: note-in 0.5s 0.35s var(--ease) both; }
  .me__arrow path { stroke-dasharray: 1; animation: draw 0.55s 0.75s var(--ease) both; }
  .me__arrow path + path { animation-duration: 0.25s; animation-delay: 1.25s; }
  .mark svg { transform-origin: left center; animation: underline 0.5s 0.9s var(--ease) both; }
}
@keyframes note-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .agent, .arrow-link::after, .watch__go { transition: none; }
}
