/* ============================================================
   Тимон ищет дом — лендинг
   «Тёплый дневник»: бумага, терракота (цвет шлейки Тимона), графит
   ============================================================ */

:root {
  --paper: #F7EFE1;
  --paper-deep: #F0E4CF;
  --card: #FFFCF5;
  --ink: #2E2620;
  --ink-soft: #5C5046;
  --muted: #8A7B6C;
  --line: #E7D9C3;
  --terra: #D9551F;
  --terra-dark: #B84316;
  --terra-soft: #F4D9C6;
  --sage: #5F7A4A;
  --sage-soft: #E4EDDA;
  --shadow: 0 18px 40px -18px rgba(46, 38, 32, .28);
  --shadow-sm: 0 8px 20px -10px rgba(46, 38, 32, .22);
  --radius: 18px;
  --font-display: Georgia, 'Times New Roman', 'Iowan Old Style', serif;
  --font-body: 'Segoe UI', Aptos, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Лёгкая «бумажная» зернистость */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.6'/></svg>");
}

main, header, footer { position: relative; z-index: 1; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

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

::selection { background: var(--terra-soft); }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn svg { width: 19px; height: 19px; flex: 0 0 auto; fill: currentColor; }

.btn-primary {
  background: var(--terra);
  color: #FFF9F2;
  box-shadow: 0 12px 24px -12px rgba(217, 85, 31, .55);
}
.btn-primary:hover {
  background: var(--terra-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(217, 85, 31, .6);
}
.btn-primary:active { transform: translateY(0); }

.btn-call, .btn-ghost {
  background: var(--card);
  color: var(--terra-dark);
  border-color: #EEC9B0;
}
.btn-call:hover, .btn-ghost:hover {
  border-color: var(--terra);
  transform: translateY(-2px);
}

/* «Пульс» на кнопке звонка */
.pulse { animation: pulse-ring 2.4s ease-out infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(217, 85, 31, .35); }
  70% { box-shadow: 0 0 0 16px rgba(217, 85, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 85, 31, 0); }
}

.btn-big {
  flex-direction: column;
  gap: 2px;
  padding: 20px 34px;
  border-radius: 22px;
}
.btn-big small { font-weight: 600; font-size: 14px; opacity: .85; letter-spacing: .02em; }
.btn-light {
  background: #FFF9F2;
  color: var(--terra-dark);
}
.btn-light:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -14px rgba(0, 0, 0, .35); }

/* ---------- Шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 239, 225, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}
.brand em {
  font-style: italic;
  font-weight: 400;
  color: var(--terra);
}
.brand-paw {
  width: 26px;
  height: 26px;
  fill: var(--terra);
}
.topnav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.topnav a:hover { color: var(--terra-dark); border-color: var(--terra); }

.btn-call-top { padding: 11px 20px; font-size: 15px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
}
.hero-blob {
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  right: -180px;
  top: -220px;
  background: radial-gradient(circle, rgba(217, 85, 31, .16), transparent 65%);
  pointer-events: none;
}
.hero-blob::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  left: -560px;
  bottom: -300px;
  background: radial-gradient(circle, rgba(95, 122, 74, .14), transparent 65%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}

.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 14px;
}
.kicker.center { text-align: center; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -.01em;
  margin-bottom: 22px;
}

.lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 34px;
}

.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}
.hero-facts li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  flex: 0 0 auto;
}

/* Поляроид */
.hero-photo {
  position: relative;
  margin: 0;
  background: var(--card);
  padding: 14px 14px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: rotate(-2.5deg);
  transition: transform .3s ease;
}
.hero-photo:hover { transform: rotate(-1deg) scale(1.01); }
.hero-photo::before,
.hero-photo::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 26px;
  background: rgba(244, 217, 198, .75);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.hero-photo::before { top: -12px; left: 34px; transform: rotate(-7deg); }
.hero-photo::after { top: -10px; right: 40px; transform: rotate(5deg); }
.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}
.hero-photo figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  padding-top: 14px;
}

/* ---------- Секции ---------- */

.section { padding: 84px 0; }
.section:nth-child(even) { background: var(--paper-deep); }

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.15;
  text-align: center;
  margin-bottom: 16px;
}
.section-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 44px;
}

/* ---------- «Кто он» ---------- */

.who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 10px;
}
.who-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.who-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.who-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--terra-soft);
  color: var(--terra-dark);
  margin-bottom: 18px;
}
.who-icon svg { width: 32px; height: 32px; fill: currentColor; }
.who-icon #i-ear { fill: currentColor; }
.who-card h3 {
  font-family: var(--font-display);
  font-size: 21px;
  margin-bottom: 10px;
}
.who-card p { color: var(--ink-soft); font-size: 15.5px; }
.who-note {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  font-style: italic;
  margin-top: 34px;
}

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

.story-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.story-photo {
  margin: 0;
  background: var(--card);
  padding: 12px 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}
.story-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}
.story-photo figcaption {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  padding-top: 12px;
}
.story-copy h2 { text-align: left; margin-bottom: 18px; }
.story-copy p { color: var(--ink-soft); font-size: 17px; margin-bottom: 16px; }
.story-quote {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--terra);
  background: var(--card);
  border-radius: 0 14px 14px 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.story-quote strong { color: var(--terra-dark); }
.story-muted { color: var(--muted) !important; font-style: italic; font-size: 15px !important; }

/* ---------- Галерея ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.g-item {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform .22s ease, box-shadow .22s ease;
}
.g-item:hover { transform: translateY(-5px) scale(1.015); box-shadow: var(--shadow); }
.g-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .4s ease;
}
.g-item:hover img { transform: scale(1.05); }

.gallery-grid.grown {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
}
.g-item.tall img { aspect-ratio: 9 / 14; }
.g-item figcaption {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
}

.gallery-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 40px 0;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}
.gallery-divider::before,
.gallery-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.gallery-divider span { white-space: nowrap; }

.gallery-note {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  color: var(--terra-dark);
  margin-top: 44px;
}

/* ---------- «Он готов» ---------- */

.ready-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 26px;
  align-items: start;
  max-width: 980px;
  margin: 10px auto 0;
}
.ready-list {
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px;
}
.ready-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 16px;
  color: var(--ink-soft);
}
.ready-list svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--sage);
  stroke: currentColor;
  fill: none;
}
.ready-note {
  background: linear-gradient(150deg, #FCE8D9, #F7D9C4);
  border: 1px solid #F0C7AA;
  border-radius: var(--radius);
  padding: 30px 28px;
}
.ready-note h3 {
  font-family: var(--font-display);
  font-size: 21px;
  margin-bottom: 12px;
}
.ready-note p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- «Как забрать» ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1040px;
  margin: 10px auto 0;
  counter-reset: step;
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--terra);
  color: #FFF9F2;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px -8px rgba(217, 85, 31, .5);
}
.step h3 { font-family: var(--font-display); font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: 15.5px; }
.step-calls { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.step-calls .btn { justify-content: flex-start; padding: 12px 18px; font-size: 14.5px; }
.step-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}
.step-meta svg { width: 17px; height: 17px; flex: 0 0 auto; fill: currentColor; color: var(--terra); }

/* ---------- Финальный CTA ---------- */

.final { background: transparent; }
.final-panel {
  background: linear-gradient(135deg, #B84316 0%, #D9551F 55%, #E07A3C 100%);
  border-radius: 28px;
  padding: 64px 40px;
  text-align: center;
  color: #FFF9F2;
  box-shadow: 0 30px 60px -24px rgba(184, 67, 22, .55);
  position: relative;
  overflow: hidden;
}
.final-panel::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%);
  left: -140px;
  top: -160px;
}
.final-kicker { color: #FFD9BE; }
.final-panel h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  color: #FFF9F2;
  margin-bottom: 12px;
}
.final-sub {
  font-size: 18px;
  opacity: .92;
  max-width: 480px;
  margin: 0 auto 36px;
}
.final-calls {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.final-links {
  margin-top: 34px;
  font-size: 15px;
}
.final-links a {
  color: #FFE9D8;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.final-links a:hover { color: #fff; }
.final-links span { opacity: .5; margin: 0 8px; }

/* ---------- «О приюте» (информация для модерации) ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1040px;
  margin: 10px auto 0;
}
.about-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.about-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--terra-dark);
}
.about-card p { color: var(--ink-soft); font-size: 14.5px; }
.about-req-name { font-weight: 700; color: var(--ink) !important; margin-bottom: 10px; }
.about-note { color: var(--muted) !important; font-size: 13px !important; margin-top: 12px; font-style: italic; }
.about-list {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; max-width: 560px; }
}

/* ---------- Футер ---------- */

.footer {
  padding: 40px 0 110px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer p { color: var(--ink-soft); font-size: 15px; }
.footer-muted { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Мобильная панель звонка ---------- */

.mobile-callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247, 239, 225, .94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: none;
}
.mobile-callbar .btn { width: 100%; }

/* ---------- Лайтбокс ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(30, 24, 18, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lb-figure {
  margin: 0;
  max-width: min(92vw, 900px);
  max-height: 84vh;
  text-align: center;
}
.lb-figure img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  object-fit: contain;
}
.lb-figure figcaption {
  color: #EFE3D2;
  font-size: 15px;
  margin-top: 14px;
  font-style: italic;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, transform .15s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .25); transform: scale(1.05); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.05); }

/* ---------- Появление при скролле ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-photo { max-width: 460px; margin: 0 auto; }
  .hero { padding: 56px 0 68px; }
  .who-grid { grid-template-columns: 1fr; max-width: 520px; margin: 10px auto 0; }
  .story-grid { grid-template-columns: 1fr; gap: 44px; }
  .story-photo { max-width: 420px; margin: 0 auto; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid.grown { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .ready-grid { grid-template-columns: 1fr; max-width: 640px; }
  .steps { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .topnav { display: none; }
  .btn-call-top { padding: 10px 14px; font-size: 14px; }
  .brand { font-size: 19px; }
  .hero { padding: 44px 0 56px; }
  .hero-actions .btn { width: 100%; }
  .final-panel { padding: 48px 22px; }
  .final-calls { flex-direction: column; align-items: stretch; max-width: 420px; margin: 0 auto; }
  .footer { padding-bottom: 96px; }
  .mobile-callbar { display: block; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* ---------- Уважение к reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
