/* ============================================================
   К.Бюро — стили сайта
   Палитра и типографика — из брендбука проекта.
   ============================================================ */

@font-face {
  font-family: 'Five Years Later';
  src: url('../fonts/FiveYearsLater.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #231f20;
  --paper: #ffffff;
  --muted: #444444;
  --placeholder: #8a8a8a;
  --beige: #cab0a6;
  --green: #a9bea0;
  --orange: #dc886f;
  --line: rgba(35, 31, 32, .14);

  --sans: 'Five Years Later', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;

  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--orange); }

img { max-width: 100%; }
input, textarea, button { font-family: inherit; }
input:focus, textarea:focus { outline: none; }
::placeholder { color: var(--placeholder); }
[hidden] { display: none !important; }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nowrap { white-space: nowrap; }

.num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5em;
  line-height: 1;
}
.num--sm { font-size: 1.3em; }

.arrow { font-size: 18px; }

.logo { height: 30px; width: auto; display: block; }
.logo--sm { height: 26px; }
.logo--xs { height: 20px; opacity: .85; }
.logo-link { display: block; }

/* ---------- ссылка со стрелкой ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  width: max-content;
}
.link-arrow__text,
.link-arrow__text-plain {
  text-decoration: underline;
  text-decoration-color: rgba(35, 31, 32, .5);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  line-height: 1.6;
}
.link-arrow__text-plain {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  text-decoration: none;
}
.link-arrow--light .link-arrow__text {
  text-decoration-color: rgba(255, 255, 255, .5);
}
.inline-link { border-bottom: 1px solid var(--ink); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: var(--ink);
}
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(35, 31, 32, .55) 0%,
    rgba(35, 31, 32, .15) 22%,
    rgba(35, 31, 32, 0) 36%,
    rgba(35, 31, 32, 0) 50%,
    rgba(35, 31, 32, .72) 100%);
}
.hero__logo {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  left: var(--gutter);
  display: block;
}
.hero__logo .logo { filter: drop-shadow(0 1px 4px rgba(35, 31, 32, .45)); }

.hero__nav {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 15px;
  letter-spacing: .01em;
}
.hero__nav a { color: #fff; padding: 2px 0; }
.hero__nav a:hover { color: var(--orange); }

.hero__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 var(--gutter) clamp(28px, 4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
  color: #fff;
}
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 5.6vw, 96px);
  line-height: 1.1;
  max-width: 16ch;
  text-wrap: balance;
}
.hero__lead {
  pointer-events: auto;
  color: #fff;
  font-weight: 500;
}
.hero__lead:hover { color: var(--orange); }

/* ---------- бургер ---------- */
.burger {
  all: unset;
  cursor: pointer;
  position: absolute;
  top: clamp(14px, 3vw, 40px);
  right: calc(var(--gutter) - 10px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  width: 44px;
  height: 44px;
}
.burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
}
.burger span:nth-child(2) { width: 16px; }
.burger--light span {
  background: #fff;
  box-shadow: 0 1px 3px rgba(35, 31, 32, .5);
}

/* ============================================================
   ШАХМАТНАЯ ДОСКА (главная)
   ============================================================ */
.board {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.board__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  direction: ltr;
}
.board__row--rev { direction: rtl; }
.board__row--rev > * { direction: ltr; }

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(28px, 4vw, 56px) var(--gutter);
  min-height: clamp(360px, 42vw, 640px);
}
.tile--beige  { background: var(--beige); }
.tile--green  { background: var(--green); }
.tile--orange { background: var(--orange); }
.tile--white {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tile--orange .link-arrow:hover { color: #fff; }

.tile__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: .06em;
}
.tile__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tile__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 68px);
  line-height: 1.1;
}
.tile__text {
  margin: 0;
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.45;
  max-width: 38ch;
}

.tile-photo {
  position: relative;
  min-height: clamp(360px, 42vw, 640px);
  background: var(--beige);
}
.tile-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile-photo--switch { cursor: pointer; }
.tile-photo--switch > img {
  opacity: 0;
  transition: opacity .4s ease;
}
.tile-photo--switch > img.is-on { opacity: 1; }

.gallery-badge {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(35, 31, 32, .55);
  color: #fff;
  font-size: 13px;
  letter-spacing: .04em;
  pointer-events: none;
}
.gallery-badge .num { font-size: 15px; }
.gallery-badge__icon { font-size: 15px; }

/* ============================================================
   ШАПКА ВНУТРЕННИХ СТРАНИЦ
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.4vw, 28px) var(--gutter);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 15px;
}
.topbar__nav a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.topbar__nav a:hover { color: var(--orange); }
.topbar__nav a.is-active { border-bottom-color: var(--ink); }
.topbar .burger { position: static; }

/* ============================================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================================ */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 20px 20px 32px;
}
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.menu-close {
  all: unset;
  cursor: pointer;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
}
.menu-close span {
  position: absolute;
  left: 10px;
  top: 21px;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
}
.menu-close span:nth-child(1) { transform: rotate(45deg); }
.menu-close span:nth-child(2) { transform: rotate(-45deg); }

.menu-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.menu-nav a {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.2;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.menu-nav a:last-child { border-bottom: 0; }
.menu-foot { font-size: 13px; color: var(--muted); }

/* ============================================================
   ОБЩЕЕ ДЛЯ ВНУТРЕННИХ СТРАНИЦ
   ============================================================ */
.page { flex: 1; }
.page__head {
  padding: clamp(36px, 6vw, 96px) var(--gutter) clamp(20px, 2.6vw, 36px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  border-bottom: 1px solid var(--line);
}
.page__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 120px);
  line-height: 1.08;
}
.page__title--narrow { max-width: 12ch; }
.page__kicker {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
  padding-bottom: 10px;
}

/* ============================================================
   ПОЗИЦИЯ
   ============================================================ */
.position {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}
.position__aside {
  position: relative;
  padding: var(--gutter);
  border-right: 1px solid var(--line);
}
.position__portrait {
  position: sticky;
  top: 96px;
  aspect-ratio: 4 / 5;
  background: var(--beige);
  overflow: hidden;
}
.position__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}
.position__text {
  padding: clamp(28px, 5vw, 72px);
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.65;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  text-wrap: pretty;
}
.position__text p { margin: 0; }
.position__text .lede {
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.35;
}
.position__text blockquote {
  margin: .6em 0;
  padding: clamp(24px, 3vw, 40px) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1.2;
  text-wrap: balance;
}
.position__links {
  margin-top: 1.5em;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  font-size: 15px;
}
.position__links .link-arrow__text { text-decoration-color: var(--ink); }

/* ============================================================
   ФОРМЫ И ФОРМАТЫ
   ============================================================ */
.forms { padding: 0 var(--gutter); }

.forms__legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 0 40px;
  padding: 18px 0;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.forms__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px 48px;
  padding: clamp(28px, 3.5vw, 52px) 0;
  border-bottom: 1px solid var(--line);
}
.forms__name {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 40px);
  line-height: 1.15;
}
.forms__name-wrap { position: relative; }
.forms__desc {
  margin: 0;
  position: relative;
  font-size: clamp(17px, 1.25vw, 20px);
  line-height: 1.55;
  max-width: 64ch;
  text-wrap: pretty;
}

.term {
  all: unset;
  cursor: help;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted var(--orange);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.term--lg {
  text-align: left;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.term__comma {
  display: inline-block;
  text-decoration: none;
}

.tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 30;
  display: block;
  width: min(420px, 100%);
  padding: 18px 20px;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 12px 40px rgba(35, 31, 32, .25);
}
.tip--block { top: calc(100% + 12px); }

.topics {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 64ch;
}
.topics__label {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
}
.topics__list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.topic {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  align-items: baseline;
}
.topic__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.3;
  color: var(--orange);
}
.topic__name {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: .02em;
}
.topic__desc {
  grid-column: 2;
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
}

.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px 40px;
  padding: clamp(40px, 5vw, 72px) 0 clamp(48px, 6vw, 96px);
}
.route__left, .route__right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.route__label {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
}
.route__img { width: min(220px, 60%); height: auto; display: block; }
.route__text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.15;
  max-width: 26ch;
  text-wrap: balance;
}
.route .link-arrow__text { text-decoration-color: var(--ink); }

/* ============================================================
   МАРГИНАЛИИ
   ============================================================ */
.notes__intro {
  padding: clamp(24px, 4vw, 56px) var(--gutter) 0;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
}
.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(48px, 6vw, 96px);
}
.note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(24px, 3vw, 40px);
  min-height: 360px;
  border: 1px solid var(--line);
  margin: 0 -1px -1px 0;
  background: var(--paper);
}
.note:hover { color: var(--ink); }
.note--beige:hover { background: var(--beige); }
.note--green:hover { background: var(--green); }
.note--filler {
  position: relative;
  background: var(--beige);
  border-color: transparent;
  overflow: hidden;
}
.note__deco {
  position: absolute;
  right: -6%;
  bottom: -8%;
  width: 62%;
  max-width: 320px;
  opacity: .9;
  pointer-events: none;
}
.note__meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: .06em;
}
.note__meta .num { letter-spacing: 0; }
.note__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.15;
}
.note__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

/* ============================================================
   СВЯЗЬ / ФОРМА
   ============================================================ */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.contact__aside {
  padding: clamp(28px, 5vw, 72px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 32px;
  justify-content: space-between;
}
.contact__lede {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 42px);
  line-height: 1.12;
  max-width: 22ch;
  text-wrap: balance;
}
.contact__deco {
  width: min(200px, 45%);
  height: auto;
  display: block;
  align-self: flex-end;
}
.contact__form {
  padding: clamp(28px, 5vw, 72px);
}
#form-fields {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
}
.field textarea,
.field input {
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 10px 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 0;
  font-weight: 400;
  border-radius: 0;
  -webkit-appearance: none;
}
.field textarea { resize: vertical; }
.field textarea:focus,
.field input:focus { border-bottom-color: var(--orange); }
.field.has-error textarea,
.field.has-error input { border-bottom-color: #b4442e; }

/* honeypot — вне поля зрения человека, но доступен ботам */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-error {
  font-size: 14px;
  line-height: 1.45;
  color: #b4442e;
}

.contact__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}
.btn {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 18px 28px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background .2s ease, color .2s ease;
}
.btn:hover { background: var(--orange); color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn[disabled]:hover { background: var(--ink); color: #fff; }

.contact__consent {
  font-size: 13px;
  color: var(--muted);
  max-width: 36ch;
  line-height: 1.45;
}

.sent {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--green);
}
.sent__label { font-size: 13px; letter-spacing: .06em; }
.sent__text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.15;
}
.sent__again {
  all: unset;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid var(--ink);
  width: max-content;
}

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: clamp(24px, 3vw, 40px) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  font-size: 14px;
  color: var(--muted);
}
.footer__left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer__nav a { color: var(--muted); }
.footer__nav a:hover { color: var(--ink); }

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ (< 760px)
   ============================================================ */
@media (max-width: 759px) {
  .hero { min-height: 480px; }
  .hero__nav { display: none; }
  .topbar__nav { display: none; }
  .burger { display: flex; }
  .footer__nav { display: none; }

  .tile { min-height: auto; }
  .tile-photo { min-height: min(78vw, 440px); }

  .position { grid-template-columns: minmax(0, 1fr); }
  .position__aside { border-right: 0; }
  .position__portrait { position: static; aspect-ratio: 4 / 3; }

  .forms__legend { display: none; }
  .forms__row { grid-template-columns: minmax(0, 1fr); }
  .route { grid-template-columns: minmax(0, 1fr); }

  .topic { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .topic__desc { grid-column: 1; margin-bottom: 16px; font-size: 16px; }
  .topic__name { font-size: 16px; }

  .contact__aside { border-right: 0; }
}

@media (min-width: 760px) {
  .menu-overlay { display: none !important; }
}
