:root {
  --bg: #F3F1EA;
  --bg-card: #FFFFFF;
  --ink: #211F1B;
  --ink-soft: #55524A;
  --ink-faint: #8B877C;
  --brick: #A93226;
  --brick-dark: #7C241A;
  --wood: #B08A63;
  --line: rgba(33, 31, 27, 0.12);
  --radius: 14px;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.mono { font-family: var(--font-mono); font-size: 15px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn--primary {
  background: var(--brick);
  color: #FFF;
}
.btn--primary:hover { background: var(--brick-dark); transform: translateY(-1px); }
.btn--primary:focus-visible { outline: 3px solid var(--wood); outline-offset: 2px; }
.btn--full { width: 100%; text-align: center; }

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,18,15,0.5) 0%, rgba(20,18,15,0.25) 30%, rgba(20,18,15,0.35) 55%, rgba(20,18,15,0.9) 100%);
}
.hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px clamp(20px, 5vw, 64px);
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.nav-cta {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  text-decoration: none;
}
.hero__content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 clamp(20px, 5vw, 64px) clamp(48px, 8vw, 88px);
  max-width: 720px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5.5vw, 58px);
  line-height: 1.08;
  margin: 14px 0 18px;
  letter-spacing: -0.01em;
}
.hero__lead {
  font-size: clamp(16px, 1.8vw, 19px);
  max-width: 480px;
  opacity: 0.92;
  margin: 0 0 28px;
}

/* Notes strip */
.notes { padding: 88px 0 40px; }
.notes__inner { max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.notes__strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 32px 4px 16px;
  scroll-snap-type: x proximity;
}
.note-card {
  flex: 0 0 78vw;
  max-width: 260px;
  margin: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 12px 18px;
  box-shadow: 0 10px 30px rgba(33,31,27,0.08);
  scroll-snap-align: start;
}
.note-card img {
  border-radius: 8px;
  aspect-ratio: 4/5;
  object-fit: cover;
  margin-bottom: 14px;
}
.note-card figcaption {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.note-card--1 { transform: rotate(-1.5deg); }
.note-card--2 { transform: rotate(1deg); }
.note-card--3 { transform: rotate(-0.5deg); }
.note-card--4 { transform: rotate(1.5deg); }

/* Gallery */
.gallery { padding: 40px clamp(20px, 5vw, 64px) 20px; }
.gallery__grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.g-item {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
}
.g-item--wide { grid-column: span 2; }

/* Inventory */
.inventory { padding: 88px 0; }
.inventory__inner { max-width: 1000px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.inventory__note { color: var(--ink-soft); margin: 0 0 32px; }
.inventory__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  font-family: var(--font-mono);
}
.inv-col h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
  color: var(--brick);
}
.inv-col ul { list-style: none; margin: 0; padding: 0; }
.inv-col li {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.inv-col li:first-child { border-top: none; }

/* Booking */
.booking { padding: 40px clamp(20px, 5vw, 64px) 100px; background: #EAE6DC; }
.booking__inner { max-width: 640px; margin: 0 auto; }
.booking__box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 20px 50px rgba(33,31,27,0.1);
}
.booking__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.booking__dates label, .booking__form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 14px;
}
.booking__dates label { margin-bottom: 0; }
input[type="date"], input[type="text"], input[type="tel"], input[type="email"] {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
input:focus-visible { outline: 2px solid var(--brick); outline-offset: 1px; }

.booking__quote {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.quote-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.quote-row--accent { color: var(--brick); font-weight: 700; font-size: 16px; }

.booking__error {
  margin-top: 16px;
  padding: 12px 14px;
  background: #FBEAF0;
  color: var(--brick-dark);
  border-radius: 8px;
  font-size: 14px;
}

.booking__form { margin-top: 24px; }

.form-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 12px; }

/* Footer */
.site-footer { padding: 48px clamp(20px, 5vw, 64px); background: var(--ink); color: rgba(255,255,255,0.75); }
.site-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  line-height: 1.7;
}
.site-footer a { text-decoration: none; }

.empty-state { padding: 120px 20px; text-align: center; font-family: var(--font-body); color: var(--ink-soft); }

@media (max-width: 780px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .g-item--wide { grid-column: span 2; }
  .g-item { height: 200px; }
  .inventory__grid { grid-template-columns: 1fr 1fr; }
  .booking__dates { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Features */
.features { padding: 56px clamp(20px, 5vw, 64px) 0; }
.features__inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--line);
}
.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 10px;
  color: var(--brick);
}
.feature-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 780px) {
  .features__inner { grid-template-columns: 1fr; }
}

/* Узкие телефоны */
@media (max-width: 480px) {
  .inventory__grid { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .gallery__grid { gap: 10px; }
  .g-item { height: 160px; }
  .hero__nav { padding: 20px 16px; }
  .hero__content { padding: 0 16px 40px; }
  .notes__inner, .gallery, .inventory__inner, .booking { padding-left: 16px; padding-right: 16px; }
  .booking__box { padding: 20px; }
  .site-footer__inner { flex-direction: column; }
}

/* Убираем залипание подсветки при тапе на мобильных */
a, button, input { -webkit-tap-highlight-color: transparent; }

/* Не даём странице скроллиться вбок из-за широких элементов */
html, body { overflow-x: hidden; }


/* Brand tag */
.brand-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  margin-top: 18px;
}
.brand-tag--light {
  background: #FBEAF0;
  border: none;
  color: var(--brick-dark);
  margin: 0 0 10px;
}

.booking__guests {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.booking__guests label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 600;
}
input[type="number"] {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

@media (max-width: 480px) {
  .booking__guests { grid-template-columns: 1fr 1fr; }
}

/* hidden атрибут должен всегда побеждать другие display-правила */
[hidden] { display: none !important; }

/* ===== Фаза 4: страница отдельной квартиры (/a/{slug}) ===== */

.a-hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.a-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.a-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(33,31,27,0.15) 0%, rgba(33,31,27,0.75) 100%);
}
.a-hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
}
.a-hero__back {
  color: #FFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  opacity: 0.9;
}
.a-hero__back:hover { opacity: 1; }
.a-hero__content {
  position: relative;
  z-index: 2;
  padding: 0 32px 56px;
  max-width: 720px;
  color: #FFF;
}
.a-hero__content .eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.85;
  display: block;
  margin-bottom: 12px;
}
.a-hero__content h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

.a-about {
  padding: 64px 32px;
  background: var(--bg-card);
}
.a-about__inner {
  max-width: 720px;
  margin: 0 auto;
}
.a-about__text {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  white-space: pre-line;
}

/* ===== Фаза 4: каталог квартир (/) ===== */

.c-hero {
  padding: 96px 32px 64px;
  max-width: 960px;
  margin: 0 auto;
}
.c-hero__nav { margin-bottom: 48px; }
.c-hero__nav .logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}
.c-hero__content .eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--wood);
  display: block;
  margin-bottom: 16px;
}
.c-hero__content h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.c-hero__lead {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0;
}

.c-listing {
  padding: 0 32px 96px;
}
.c-listing__inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.c-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.c-card:hover {
  transform: translateY(-2px);
  border-color: var(--wood);
}
.c-card--feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
}
.c-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.c-card--feature .c-card__media { aspect-ratio: auto; height: 100%; min-height: 320px; }
.c-card__media img { width: 100%; height: 100%; object-fit: cover; }
.c-card__body { padding: 24px; }
.c-card--feature .c-card__body { display: flex; flex-direction: column; justify-content: center; }
.c-card__address {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 8px;
}
.c-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.c-card--feature .c-card__title { font-size: 28px; }
.c-card__desc {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.c-card__price {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--brick);
  font-weight: 500;
}

@media (max-width: 720px) {
  .c-listing__inner { grid-template-columns: 1fr; }
  .c-card--feature { grid-template-columns: 1fr; }
  .c-card--feature .c-card__media { min-height: 220px; }
}

/* ===== Фаза 4: слайдер галереи на странице квартиры ===== */

.gallery--slider { padding: 0; }
.gallery-slider {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}
.gallery-slider__main {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
}
.gallery-slider__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.gallery-slider__arrow:hover { background: #FFF; }
.gallery-slider__arrow--prev { left: 16px; }
.gallery-slider__arrow--next { right: 16px; }
.gallery-slider__counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(33,31,27,0.7);
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
}
.gallery-slider__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-slider__thumb {
  width: 90px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-slider__thumb:hover { opacity: 0.85; }
.gallery-slider__thumb.is-active {
  opacity: 1;
  border-color: var(--brick);
}

@media (max-width: 640px) {
  .gallery-slider { padding: 0 16px; }
  .gallery-slider__arrow { width: 36px; height: 36px; font-size: 20px; }
  .gallery-slider__thumb { width: 64px; height: 46px; }
}

/* Фаза 4: hero каталога с фоновым фото */
.c-hero--photo {
  background-size: cover;
  background-position: center;
  padding-top: 140px;
  padding-bottom: 96px;
  max-width: none;
}
.c-hero--photo .c-hero__nav .logo,
.c-hero--photo .c-hero__content .eyebrow,
.c-hero--photo .c-hero__content h1 {
  color: #FFF;
}
.c-hero--photo .c-hero__lead {
  color: rgba(255,255,255,0.85);
}
.c-hero--photo .c-hero__nav,
.c-hero--photo .c-hero__content {
  max-width: 960px;
  margin: 0 auto;
}
.c-hero--photo .c-hero__nav { margin-bottom: 48px; padding: 0 32px; }
.c-hero--photo .c-hero__content { padding: 0 32px; }
