/* Палитра — из Mini App (miniapp/src/theme.css) + один акцент: ягодный.
   Скругления: кнопки 12px, блоки 24px — везде одинаково.
   Шрифты свои (fontsource, OFL), кириллица и латиница отдельными файлами. */
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/unbounded-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(fonts/manrope-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --bg: #FFFFFF;
  --text: #0B0B0C;
  --text-secondary: #55524D;
  --line: #C9C6C0;
  --card: #F3F0EB;
  --moon: #CDC6BD;
  --ink: #0B0B0C;
  /* Бренд «Лунатик»: без цветного акцента. Главная кнопка — чёрная, вторичная — лунная заливка.
     Лунный (#CDC6BD) — только заливка, никогда не цвет текста. */
  --primary: #0B0B0C;
  --primary-hover: #2A2A2D;
  --on-primary: #FFFFFF;
  --secondary: #CDC6BD;
  --secondary-hover: #C2BAB0;
  --on-secondary: #0B0B0C;
  --on-moon-soft: #3A3835;  /* вторичный текст на лунной заливке: 6.9:1 */
  --moon-hover: #C2BAB0;
  --city-main: #0B0B0C;
  --font-title: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Manrope', system-ui, sans-serif;
  --r-btn: 12px;
  --r-block: 24px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0C;
    --text: #FFFFFF;
    --text-secondary: #B5B2AC;
    --line: #3A3A3E;
    --card: #1E1E21;
    /* ночью чёрная кнопка потерялась бы на фоне — главная становится лунной, как «ВЫБРАТЬ ГОРОД» в Mini App */
    --primary: #CDC6BD;
    --primary-hover: #DAD4CC;
    --on-primary: #0B0B0C;
    --secondary: #2A2A2D;
    --secondary-hover: #36363A;
    --on-secondary: #FFFFFF;
    --city-main: #1E1E21;   /* чёрная плитка на чёрном фоне терялась */
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--moon); color: var(--ink); }
html { scrollbar-color: var(--line) transparent; }
section[id] { scroll-margin-top: 88px; } /* якорь не прячется под липкой шапкой */
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 32px; max-width: 18ch; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 96px; padding-bottom: 32px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-btn);
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform .2s cubic-bezier(.16,1,.3,1), background-color .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-moon { background: var(--secondary); color: var(--on-secondary); }
.btn-moon:hover { background: var(--secondary-hover); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* Шапка */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-row { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 700; font-size: 18px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-tag { font-family: var(--font-text); font-weight: 600; font-size: 12px; letter-spacing: 0; color: var(--text-secondary); }
.nav nav { display: flex; gap: 24px; margin-left: auto; font-weight: 600; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--text-secondary); }
.nav nav a:hover { color: var(--text); }

/* Первый экран: текст слева, знак справа */
.hero {
  display: grid; grid-template-columns: 1.6fr 1fr; align-items: center; gap: 48px;
  min-height: calc(100dvh - 68px); max-height: 860px; padding-top: 32px; padding-bottom: 48px;
}
.hero h1 { font-size: clamp(34px, 4.6vw, 60px); max-width: 20ch; }
/* акцент в заголовке — лунная плашка под словами, текст остаётся чёрным */
.hero h1 em { font-style: normal; color: var(--ink); background: var(--moon); padding: 0 .16em; border-radius: 10px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lead { font-size: 19px; color: var(--text-secondary); max-width: 34ch; margin-top: 24px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-art { justify-self: end; width: min(100%, 480px); }
.hero-art img { width: 100%; }

/* Города: большая плитка + две поменьше */
.cities { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.city {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 32px; border-radius: var(--r-block); text-decoration: none; min-height: 220px;
}
.city-main { grid-row: span 2; min-height: 460px; background: var(--city-main); color: #FFFFFF; }
.has-photo { position: relative; overflow: hidden; isolation: isolate; color: #FFFFFF; }
.city-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform .8s cubic-bezier(.16,1,.3,1); }
/* затемнение снизу — белый текст читается на любом кадре */
.has-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(11 11 12 / .94) 0%, rgb(11 11 12 / .78) 32%, rgb(11 11 12 / .25) 58%, rgb(11 11 12 / 0) 76%); }
a.has-photo:hover .city-photo { transform: scale(1.03); }
.city-alt { background: var(--moon); }
.city-alt:not(.has-photo) { color: var(--ink); }
.city-alt:not(.has-photo) .city-text { color: var(--on-moon-soft); }
.city-soon { background: var(--card); }
.city-name { font-family: var(--font-title); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; }
.city-soon .city-name { font-size: 22px; line-height: 1.25; }
.city-text { max-width: 32ch; opacity: 1; }
.has-photo .city-text { color: #E8E6E3; }
.city-alt { min-height: 320px; }
.city-alt .city-photo { object-position: 50% 15%; }
.city-soon .city-text { color: var(--text-secondary); }
.city-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }
.city-go svg { width: 18px; height: 18px; transition: transform .25s cubic-bezier(.16,1,.3,1); }
a.city:hover .city-go svg { transform: translateX(6px); }

/* Как это устроено: заголовок липнет слева, шаги справа */
.how { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.how h2 { position: sticky; top: 100px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: span 2; font-family: var(--font-title); font-weight: 700; font-size: 40px; line-height: 1; color: var(--text); }
.steps h3 { font-size: 24px; }
.steps p { color: var(--text-secondary); margin-top: 8px; max-width: 44ch; }

/* Манифест */
.manifesto p {
  font-family: var(--font-title); font-weight: 600; font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.3; letter-spacing: -0.015em; max-width: 26ch; text-wrap: balance;
}

/* Гидам */
.guides { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.guides-head p { color: var(--text-secondary); max-width: 40ch; margin: -12px 0 28px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.perks li { background: var(--card); border-radius: var(--r-block); padding: 28px; }
.perks li:nth-child(3) { background: var(--moon); color: var(--ink); }
.perks li:nth-child(3) p { color: var(--on-moon-soft); }
.perks p { color: var(--text-secondary); margin-top: 8px; font-size: 16px; }

/* Вопросы */
.faq-list { max-width: 860px; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-weight: 700; font-size: 18px;
}
.faq-list summary::-webkit-details-marker { display: none; }
/* «плюс» из двух полосок: при открытии вертикальная ложится — получается «минус» */
.faq-list summary::before, .faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 2px; margin-top: -1px;
  background: var(--text); border-radius: 1px; transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0deg); }
.faq-list summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.faq-list details p { color: var(--text-secondary); padding-bottom: 22px; max-width: 60ch; }

/* Финал */
.final { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 96px; }
.final h2 { margin: 0; }

.footer { border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 28px; padding-bottom: 28px; font-size: 15px; }
.footer .brand img { width: 28px; height: 28px; }
.footer nav { display: flex; gap: 20px; margin-left: auto; }
.footer nav a { color: var(--text-secondary); text-decoration: none; padding: 12px 0; }
.footer nav a:hover { color: var(--text); }
.copy { color: var(--text-secondary); }

/* --- Страницы города и экскурсии (admin_api/site_pages.py) --- */
.crumbs { padding-top: 20px; font-size: 14px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.city-hero { padding-top: 32px; padding-bottom: 8px; }
.city-hero h1 { font-size: clamp(32px, 4.4vw, 56px); max-width: 20ch; }
.section-tight { padding-top: 56px; }
.section-tight h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 24px; }
.empty p { color: var(--text-secondary); margin: -12px 0 24px; max-width: 48ch; }

.tgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px 16px; }
.tcard a { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.tcard-photo { position: relative; display: block; aspect-ratio: 16 / 11; border-radius: var(--r-block); overflow: hidden; background: var(--card); }
.tcard-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.tcard a:hover .tcard-photo img { transform: scale(1.04); }
.tcard-nophoto { position: absolute; inset: 0; background: var(--moon) url(/assets/logo-day.webp) center / 32% no-repeat; }
.tcard-badge { position: absolute; left: 12px; bottom: 12px; background: var(--ink); color: #FFFFFF; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.tcard-body { display: flex; flex-direction: column; gap: 4px; }
.tcard-title { font-family: var(--font-title); font-weight: 600; font-size: 18px; line-height: 1.3; }
.tcard a:hover .tcard-title { text-decoration: underline; text-underline-offset: 4px; }
.tcard-meta { color: var(--text-secondary); font-size: 15px; }
.tcard-price { font-weight: 700; }

.tour { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; padding-top: 24px; padding-bottom: 64px; }
.tour h1 { font-size: clamp(30px, 4vw, 48px); }
.tour .lead { max-width: 52ch; }
.tour section { margin-top: 48px; }
.tour h2 { font-size: 24px; margin-bottom: 16px; max-width: none; }
.gallery { margin-top: 32px; display: grid; gap: 8px; }
.gallery-main { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-block); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery-thumbs img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-btn); }
.highlights { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.highlights li::marker { color: var(--text-secondary); }
.prose p { max-width: 65ch; margin-bottom: 14px; }
.guide-block { display: flex; gap: 20px; align-items: flex-start; background: var(--card); border-radius: var(--r-block); padding: 28px; }
.guide-block img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; }
.guide-block h2 { font-size: 20px; margin-bottom: 8px; }
.guide-block p { color: var(--text-secondary); margin-bottom: 10px; max-width: 60ch; }
.book-card { position: sticky; top: 92px; border: 1px solid var(--line); border-radius: var(--r-block); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.book-price { font-family: var(--font-title); font-weight: 700; font-size: 32px; line-height: 1; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-size: 13px; color: var(--text-secondary); }
.facts dd { margin: 0; font-weight: 600; }
.book-card .btn { width: 100%; }
.book-note { font-size: 14px; color: var(--text-secondary); margin-top: -8px; }
.book-bar { display: none; }
@media (max-width: 900px) {
  .tour { grid-template-columns: 1fr; gap: 32px; padding-bottom: 112px; }
  .book-card { position: static; }
  /* телефон: цена и бронь всегда под пальцем, карточка с деталями — ниже текста */
  .book-bar {
    display: flex; align-items: center; gap: 16px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line);
  }
  .book-bar .btn { flex: 1; width: auto; }
  .book-bar-price { font-family: var(--font-title); font-weight: 700; font-size: 22px; white-space: nowrap; }
}

/* Движение: одно — знак «шагает» в кадр; манифест проявляется при прокрутке. Без движения — если просили */
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: step-in 1s cubic-bezier(.16,1,.3,1) .1s both; }
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes step-in { from { opacity: 0; transform: translateX(-40px) rotate(-12deg); } to { opacity: 1; transform: none; } }

/* Планшет и телефон: всё в одну колонку */
@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav-row { justify-content: space-between; }
  .hero { grid-template-columns: 1fr; min-height: 0; max-height: none; gap: 32px; padding-top: 24px; }
  .hero-art { justify-self: start; width: min(48vw, 200px); order: -1; }
  .how, .guides { grid-template-columns: 1fr; gap: 8px; }
  .how h2 { position: static; }
  .section { padding-top: 72px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  /* первый экран телефона: H1, строка, одна кнопка — и сразу плитки «Куда копаем сейчас» */
  .hero-art, .hero .btn-moon { display: none; }
  .hero { padding-top: 16px; padding-bottom: 0; gap: 0; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 16px; margin-top: 12px; }
  .ctas { margin-top: 20px; }
  #cities { padding-top: 36px; }
  #cities h2 { font-size: 24px; margin-bottom: 16px; }
  .city { min-height: 0; padding: 20px; }
  .city-main, .city-alt { min-height: 200px; }
  .city-name { font-size: 26px; }
  .brand-tag { font-size: 11px; }
  .cities { grid-template-columns: 1fr; }
  .city-main { grid-row: auto; }
  .perks { grid-template-columns: 1fr; }
  .final { flex-direction: column; align-items: flex-start; }
  .footer nav { margin-left: 0; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }
}
