/* Гостевой комплекс «Сосны» — концепт. Палитра взята с самого дома:
   штукатурка, черепица, лиственница балок, хвоя. Мотив — фахверковая рама. */

:root {
  --paper: #F4EEE3;
  --paper-deep: #E9DFCE;
  --ink: #1D2924;
  --ink-soft: #4E5A53;
  --pine: #1E3A2E;
  --pine-deep: #152A21;
  --tile: #A84724;
  --tile-deep: #8A3718;
  --larch: #C1904F;
  --larch-light: #D9B27A;
  --timber: #3A2A1E;
  --cream: #EDE6D8;
  --line: rgba(29, 41, 36, .17);
  --line-light: rgba(237, 230, 216, .22);
  --focus: #8A3718;

  --font-display: 'Oranienbaum', 'Times New Roman', Times, serif;
  --font-body: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --gutter: clamp(18px, 4vw, 48px);
  --section: clamp(56px, 8vw, 112px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .25vw, 1.0875rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: lining-nums;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1rem + 3vw, 3.1rem); line-height: 1.08; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

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

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 3px;
}
.skip:focus { top: 12px; }

/* --- общее --- */

.eyebrow {
  display: flex; align-items: center;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--tile-deep);
  margin-bottom: 18px;
}
.eyebrow--light { color: var(--larch-light); }
.concept, .history, .contacts, .foot { --focus: #D9A441; }
.nowrap { white-space: nowrap; }
.hero__hint a { color: var(--tile-deep); }

/* фахверковая метка: квадрат с раскосом */
.mark {
  flex: none; width: 12px; height: 12px; margin-right: 10px;
  border: 2px solid currentColor;
  background: linear-gradient(to top right,
    transparent calc(50% - 1px), currentColor calc(50% - 1px),
    currentColor calc(50% + 1px), transparent calc(50% + 1px));
}

.section-head__lead { margin-top: 16px; max-width: 56ch; color: var(--ink-soft); }
.section-head__lead a { color: var(--tile-deep); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border: 1.5px solid transparent; border-radius: 3px;
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn--primary { background: var(--tile); color: #FFF8EF; }
.btn--primary:hover { background: var(--tile-deep); }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { border-color: var(--cream); color: var(--cream); }
.btn--light:hover { background: var(--cream); color: var(--pine-deep); }

/* --- полоса «концепт» --- */

.concept { background: var(--pine-deep); color: var(--cream); font-size: .82rem; line-height: 1.45; }
.concept p { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: 9px; }
.concept strong { color: var(--larch-light); font-weight: 600; }

/* --- шапка --- */

.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; gap: 28px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 26px; height: 26px; fill: none; stroke: var(--timber); stroke-width: 2.2; }
.brand__name { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.brand__note { font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; line-height: 1.35; color: var(--ink-soft); }

.nav { display: flex; gap: clamp(16px, 2vw, 30px); margin-left: auto; }
.nav a { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 2px; font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--tile-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }

.top__phone { font-weight: 600; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.top__phone:hover { color: var(--tile-deep); }

/* --- первый экран --- */

.hero { padding-top: clamp(28px, 4vw, 56px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 5.5fr) minmax(0, 6.5fr); gap: clamp(28px, 4vw, 56px); align-items: center; }

h1 { font-size: clamp(2.2rem, 1.1rem + 3.6vw, 3.75rem); line-height: 1.05; letter-spacing: -.005em; }
.hero__lead { margin-top: 18px; max-width: 42ch; font-size: 1.1em; color: var(--ink-soft); }
.hero__price { margin-top: 20px; padding-left: 16px; border-left: 3px solid var(--tile); line-height: 1.3; }
.hero__price strong { font-family: var(--font-display); font-weight: 400; font-size: 1.75em; color: var(--tile-deep); white-space: nowrap; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__hint { margin-top: 16px; font-size: .88em; color: var(--ink-soft); }

.hero__photo { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.hero__photo img { width: 100%; height: 100%; aspect-ratio: 6 / 5; object-fit: cover; object-position: 62% 50%; }
.hero__photo figcaption { grid-column: 1 / -1; margin-top: 10px; font-size: .8rem; color: var(--ink-soft); text-align: right; }

.fachwerk { width: 100%; height: 100%; display: block; }
.fachwerk__fill { fill: #EFE5D3; }
.fachwerk path { fill: none; stroke: var(--timber); stroke-width: 5; vector-effect: non-scaling-stroke; }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts > div { padding: 22px 22px 24px; border-left: 1px solid var(--line); }
.facts > div:first-child { padding-left: 0; border-left: 0; }
.facts dt { font-family: var(--font-display); font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.7rem); line-height: 1; color: var(--pine); }
.facts dd { margin-top: 8px; font-size: .9em; line-height: 1.4; color: var(--ink-soft); }

/* --- комнаты --- */

.rooms { padding-block: var(--section) calc(var(--section) * .75); }
.rooms .section-head { margin-bottom: clamp(28px, 4vw, 48px); }

.room {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 60px); align-items: start;
  padding-block: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}
.room--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.room--flip .room__media { order: 2; }

.room__media { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; aspect-ratio: 2 / 1; }
.room__media img { width: 100%; height: 100%; object-fit: cover; background: var(--paper-deep); }
.room__main { grid-row: 1 / 3; }

.room__body h3 { font-size: clamp(2rem, 1.3rem + 2.2vw, 2.9rem); line-height: 1; }
.room__lead { margin-top: 12px; font-size: 1.06em; }
.room__list { margin-top: 18px; display: grid; gap: 8px; color: var(--ink-soft); font-size: .96em; }
.room__list li { position: relative; padding-left: 24px; }
.room__list li::before { content: ""; position: absolute; left: 0; top: .78em; width: 13px; height: 2px; background: var(--larch); }

.room__buy {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 20px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.price { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: 8px; }
.price__label { grid-column: 1 / -1; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.price__value { font-family: var(--font-display); font-size: 2.35rem; line-height: 1.1; color: var(--pine); white-space: nowrap; }
.price__unit { font-size: .9em; color: var(--ink-soft); }

.rooms__note { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 72ch; font-size: .88em; color: var(--ink-soft); }

/* --- цены --- */

.prices { padding-block: var(--section); background: var(--paper-deep); }
.prices__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }

.perks { margin-top: 26px; display: grid; gap: 10px; font-size: .96em; }
.perks li { padding-left: 16px; border-left: 2px solid var(--larch); }
.perks strong { color: var(--tile-deep); }

.table-scroll { overflow-x: auto; }
.tariff { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums lining-nums; }
.tariff th, .tariff td { padding: 14px 12px; text-align: right; }
.tariff th:first-child { text-align: left; padding-left: 14px; }
.tariff thead th {
  font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 3px solid var(--timber);
}
.tariff tbody tr { border-bottom: 1px solid var(--line); }
.tariff tbody th { font-weight: 500; }
.tariff td { font-size: 1.06em; }
.tariff tr.is-now { background: rgba(168, 71, 36, .09); box-shadow: inset 4px 0 0 var(--tile); }
.tariff tr.is-now td, .tariff tr.is-now th { font-weight: 600; }
.now {
  display: inline-block; margin-left: 8px; padding: 2px 7px; vertical-align: 1px;
  font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #FFF8EF; background: var(--tile); border-radius: 2px;
}

/* --- история --- */

.history { padding-block: var(--section); background: var(--pine); color: var(--cream); }
.history__grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: clamp(28px, 5vw, 72px); row-gap: 8px; align-items: start;
}
.history__year {
  grid-column: 1; font-family: var(--font-display);
  font-size: clamp(5.5rem, 2rem + 14vw, 13rem); line-height: .82; letter-spacing: -.02em;
  color: var(--larch); margin-left: -.04em; margin-bottom: clamp(16px, 2vw, 28px);
}
.history__text { grid-column: 1; }
.history__text h2 { margin-bottom: 22px; }
.history__text > p:not(.eyebrow) { max-width: 58ch; }
.history__text > p + p { margin-top: 14px; }

.timeline {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px;
  margin-top: 36px; border-top: 1px solid var(--line-light);
}
.timeline li { position: relative; padding-top: 18px; font-size: .92em; line-height: 1.35; }
.timeline li::before { content: ""; position: absolute; left: 0; top: -5px; width: 9px; height: 9px; background: var(--larch); }
.timeline span { display: block; margin-bottom: 4px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--larch-light); }

.history__photo { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.history__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.history__photo blockquote { margin-top: 22px; padding-left: 18px; border-left: 3px solid var(--larch); }
.history__photo blockquote p { font-family: var(--font-display); font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); line-height: 1.25; }
.history__photo blockquote footer { margin-top: 10px; font-size: .8rem; color: var(--larch-light); }

/* --- двор и сад --- */

.garden { padding-block: var(--section); }
.garden__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.garden__text p + p { margin-top: 12px; }
.garden__text { color: var(--ink-soft); }

.mosaic { display: grid; grid-template-columns: 7fr 2.5fr 2.5fr; gap: 8px; margin-top: clamp(28px, 4vw, 48px); }
.mosaic figure { position: relative; overflow: hidden; background: var(--paper-deep); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic__a { grid-row: 1 / 3; min-height: 240px; }
.mosaic__a img { position: absolute; inset: 0; }
.mosaic__b { grid-column: 2 / 4; }
.mosaic__b img { aspect-ratio: 16 / 9; }
.mosaic__c img, .mosaic__d img { aspect-ratio: 4 / 3; }
.mosaic figcaption {
  position: absolute; left: 0; bottom: 0; padding: 5px 10px;
  font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper); color: var(--ink);
}

.free { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 16px clamp(24px, 4vw, 56px); margin-top: 32px; padding-top: 24px; border-top: 3px solid var(--timber); }
.free h3 { font-size: 1.5rem; line-height: 1.15; }
.free ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
.free li { position: relative; padding-left: 24px; }
.free li::before { content: ""; position: absolute; left: 0; top: .78em; width: 13px; height: 2px; background: var(--larch); }

/* --- рядом --- */

.nearby { padding-block: var(--section); background: var(--paper-deep); }
.nearby__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.nearby__grid > div > p { margin-top: 18px; max-width: 46ch; }
.nearby__food { color: var(--ink-soft); }
.nearby .btn { margin-top: 26px; }

.places { border-top: 3px solid var(--timber); }
.places li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 20px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--line); }
.places strong { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.2; }
.places span { font-size: .93em; color: var(--ink-soft); }

/* --- условия и вопросы --- */

.terms { padding-block: var(--section); }
.terms__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }

.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; margin-top: 28px; }
.rules > div { padding: 15px 0 16px; border-top: 1px solid var(--line); }
.rules dt { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.rules dd { margin-top: 4px; line-height: 1.4; }

.faq h3 { font-size: 1.7rem; line-height: 1.1; padding-bottom: 14px; border-bottom: 3px solid var(--timber); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; padding: 16px 40px 16px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 2px; margin-top: -1px;
  background: var(--tile); transition: transform .2s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--tile-deep); }
.faq details p { padding: 0 40px 18px 0; color: var(--ink-soft); }
.faq__reviews { margin-top: 22px; font-size: .95em; }
.faq__reviews a { color: var(--tile-deep); }

/* --- контакты --- */

.contacts { padding-block: var(--section); background: var(--pine-deep); color: var(--cream); }
.contacts h2 { font-size: clamp(2.2rem, 1rem + 4vw, 3.8rem); }
.contacts__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 4vw, 56px); margin-top: clamp(28px, 4vw, 48px); padding-top: 28px; border-top: 1px solid var(--line-light); }
.contacts h3 { font-family: var(--font-body); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--larch-light); margin-bottom: 10px; }
.contacts__big { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.15; text-decoration: none; white-space: nowrap; }
.contacts__big:hover { color: var(--larch-light); }
.contacts__addr { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.25; }
.contacts__grid p + p { margin-top: 8px; font-size: .95em; }
.contacts__grid a:not(.contacts__big) { color: var(--larch-light); }
.contacts__grid a { display: inline-block; padding-block: 10px; }
.contacts__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 4vw, 44px); }

.foot { background: #0F1F18; color: rgba(237, 230, 216, .78); font-size: .84rem; padding-block: 26px; }
.foot p { max-width: 86ch; }
.foot p + p { margin-top: 6px; }

/* --- нижняя панель на телефоне --- */

.dock { display: none; }

/* --- движение: один раз при загрузке --- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero__text > * { animation: rise .7s var(--ease) both; }
  .hero__text > :nth-child(2) { animation-delay: .06s; }
  .hero__text > :nth-child(3) { animation-delay: .12s; }
  .hero__text > :nth-child(4) { animation-delay: .18s; }
  .hero__text > :nth-child(5) { animation-delay: .24s; }
  .hero__text > :nth-child(6) { animation-delay: .3s; }
  .hero__photo img { animation: unveil 1s var(--ease) .12s both; }
  .fachwerk { animation: rise .8s var(--ease) .1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* --- планшет и телефон --- */

@media (max-width: 959px) {
  html { scroll-padding-top: 16px; scroll-padding-bottom: 90px; }
  .room--flip { grid-template-columns: minmax(0, 1fr); }
  body { padding-bottom: 74px; }

  .top { position: static; }
  .top__row { flex-wrap: wrap; gap: 0 16px; padding-top: 10px; min-height: 0; }
  .brand { flex: 1; min-height: 48px; }
  .top__phone { display: none; } /* звонок есть в нижней панели */
  .nav {
    order: 3; width: calc(100% + 2 * var(--gutter)); margin: 8px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter);
    gap: 22px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 12px 0; }

  .hero__grid, .prices__grid, .garden__head, .nearby__grid, .terms__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__photo { grid-template-columns: 36px minmax(0, 1fr); }
  .hero__photo img { aspect-ratio: 4 / 3; }
  .hero__lead { max-width: none; }

  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { padding: 18px 16px 20px; }
  .facts > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .room { grid-template-columns: minmax(0, 1fr); }
  .room--flip .room__media { order: 0; }

  .history__grid { grid-template-columns: minmax(0, 1fr); }
  .history__photo { grid-column: 1; grid-row: auto; margin-top: 36px; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; border-top: 0; }
  .timeline li { border-top: 1px solid var(--line-light); }

  .free { grid-template-columns: minmax(0, 1fr); }
  .contacts__grid { grid-template-columns: minmax(0, 1fr); }

  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
  }
}

@media (max-height: 480px) {
  .dock { display: none; }
  body { padding-bottom: 0; }
}

@media (max-width: 639px) {
  .concept__more { display: none; }
  .hero__actions { display: none; } /* обе кнопки есть в нижней панели */

  .room__media { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; aspect-ratio: auto; }
  .room__main { grid-row: auto; grid-column: 1 / 3; aspect-ratio: 4 / 3; }
  .room__media img:not(.room__main) { aspect-ratio: 4 / 3; }
  .room__buy .btn { flex: 1 1 100%; }

  .tariff th, .tariff td { padding: 12px 4px; }
  .tariff thead th { letter-spacing: .02em; }
  .tariff th:first-child { padding-left: 10px; }
  .tariff tbody th { font-size: .9em; line-height: 1.3; }
  .now { display: block; width: max-content; margin: 4px 0 0; }

  .mosaic { grid-template-columns: 1fr 1fr; }
  .mosaic__a { grid-row: auto; grid-column: 1 / 3; min-height: 0; }
  .mosaic__a img { position: static; aspect-ratio: 4 / 3; }
  .mosaic__b { grid-column: 1 / 3; }

  .free ul { grid-template-columns: minmax(0, 1fr); }
  .places li { grid-template-columns: minmax(0, 1fr); }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .contacts__actions .btn { flex: 1 1 100%; }
}
