/* ===== Токены ===== */
:root {
  /* Цвета: тёплые бежевые и коричневые, без градиентов в фонах */
  --bg: #FBF3E6;
  --bg-sand: #F4E6D0;
  --sky: #F7E9D2;
  --surface: #FFF9EF;
  --line: #E3CDAE;
  --tan: #D8B88C;
  --caramel: #B98457;
  --brown: #8A5A3B;
  --cocoa: #5A3A27;
  --ink: #3A2418;
  --ink-soft: #C1B5A8;
  --muted: #7A5D4A;
  --ok: #6B8E4E;
  --bad: #B5483A;

  /* Отступы: только эти значения */
  --sp-0: 0;
  --sp-25: 2px;
  --sp-50: 4px;
  --sp-75: 8px;
  --sp-100: 12px;
  --sp-200: 16px;
  --sp-300: 24px;
  --sp-400: 32px;
  --sp-500: 40px;
  --sp-600: 48px;
  --sp-700: 64px;
  --sp-800: 80px;
  --sp-900: 96px;

  /* Скругления Tailwind */
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --r-full: 9999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Manrope", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--sp-800); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-style: normal;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
i.ph { font-size: 1.25em; line-height: 1; }

/* Тёплый «ночной свет» поверх всего сайта, как в Windows на средней интенсивности.
   Меняйте только цвет: чем темнее и оранжевее, тем теплее картинка. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 101;
  mix-blend-mode: multiply;
  background: #FFE4C4;
}

/* Лёгкая бумажная зернистость поверх страницы, фон остаётся плоским */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .4 0 0 0 0 .28 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Текстовые стили (шаги шкалы Tailwind) ===== */
.heading-1 { font-size: 60px; line-height: 60px; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 48px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-1 { font-size: 20px; line-height: 28px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-2 { font-size: 16px; line-height: 24px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.button-lg { font-size: 18px; line-height: 28px; font-weight: 600; }
.button-md { font-size: 16px; line-height: 24px; font-weight: 600; }
.caption-1 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }

h1, h2, h3, .heading-3 { text-wrap: balance; }
p { text-wrap: pretty; }

@media (max-width: 767px) {
  .heading-1 { font-size: 36px; line-height: 40px; }
  .heading-2 { font-size: 30px; line-height: 36px; }
  .heading-3 { font-size: 24px; line-height: 32px; }
}

/* ===== Каркас ===== */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-300); }
.section { padding: var(--sp-900) 0; }
.section-sand { background: var(--bg-sand); }
.section-head { max-width: 680px; margin-bottom: var(--sp-600); display: flex; flex-direction: column; gap: var(--sp-200); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; color: var(--brown); }
.lead { color: var(--muted); }

@media (max-width: 767px) {
  .section { padding: var(--sp-700) 0; }
  .section-head { margin-bottom: var(--sp-400); }
}

.skip-link {
  position: fixed; top: var(--sp-75); left: var(--sp-75); z-index: 200;
  padding: var(--sp-75) var(--sp-100);
  background: var(--cocoa); color: var(--bg);
  border-radius: var(--r-lg);
  transform: translateY(-200%);
  transition: transform 500ms var(--ease);
}
.skip-link:focus { transform: none; }

:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

/* ===== Навигация ===== */
.nav-wrap { position: fixed; top: var(--sp-200); left: 0; right: 0; z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--sp-300);
  padding: var(--sp-75) var(--sp-100) var(--sp-75) var(--sp-200);
  background: rgba(251, 243, 230, 0.72);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  position: relative; z-index: 2;
}
.nav-logo { display: inline-flex; align-items: center; gap: var(--sp-75); text-decoration: none; font-weight: 600; }
.nav-links { display: none; gap: var(--sp-50); }
.nav-links a {
  display: block; padding: var(--sp-75) var(--sp-100);
  border-radius: var(--r-full); text-decoration: none; color: var(--muted);
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.nav-links a:hover { background: var(--bg-sand); color: var(--ink); }
.nav-links a[aria-current="true"] { background: var(--cocoa); color: var(--bg); }

.nav-toggle {
  position: relative; width: 40px; height: 40px; margin-left: auto;
  border: 0; border-radius: var(--r-full); background: transparent; cursor: pointer; color: var(--ink);
  transition: background-color 300ms var(--ease);
}
.nav-toggle:hover { background: var(--bg-sand); }
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: var(--r-full); background: currentColor;
  transition: transform 500ms var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
.nav-toggle span { top: 19px; }

.nav-panel {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(251, 243, 230, 0.94);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  opacity: 0; visibility: hidden;
  transition: opacity 500ms var(--ease), visibility 0s linear 500ms;
}
.nav-panel ul { display: flex; flex-direction: column; gap: var(--sp-300); text-align: center; }
.nav-panel li {
  opacity: 0; transform: translateY(24px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.nav-panel a { text-decoration: none; padding: var(--sp-75) var(--sp-200); display: inline-block; font-size: 30px; line-height: 36px; }
.nav-wrap.open .nav-panel { pointer-events: auto; opacity: 1; visibility: visible; transition-delay: 0s; }
.nav-wrap.open .nav-panel li { opacity: 1; transform: none; transition-delay: calc(var(--i) * 60ms + 100ms); }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle, .nav-panel { display: none; }
  .nav { padding: var(--sp-75) var(--sp-75) var(--sp-75) var(--sp-200); }
}

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-75);
  padding: var(--sp-75) var(--sp-100);
  border: 1px solid transparent; border-radius: var(--r-xl);
  font-family: inherit; text-decoration: none; cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease), transform 500ms var(--ease), opacity 300ms var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cocoa); color: var(--bg); }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-sand); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.button-lg { padding: var(--sp-75) var(--sp-200); }

/* ===== Первый экран ===== */
.hero {
  padding: var(--sp-900) var(--sp-200) var(--sp-200);
  display: flex; flex-direction: column; gap: var(--sp-500);
}
.hero-text {
  max-width: 680px; margin: var(--sp-500) auto 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-300); text-align: center;
}
.badge {
  padding: var(--sp-50) var(--sp-100);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full);
  color: var(--brown);
}
.hero-title {
  max-width: 680px;
  background-image: linear-gradient(90deg, var(--ink), var(--brown));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { max-width: 680px; color: var(--muted); }
.hero-proof { display: inline-flex; align-items: center; gap: var(--sp-75); color: var(--muted); }

.scene {
  position: relative;
  aspect-ratio: 5 / 2;
  width: 100%; max-width: 1440px; margin: 0 auto;
  background: var(--sky);
  border-radius: var(--r-3xl);
  overflow: hidden;
  border: 1px solid var(--line);
}
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-hint {
  position: absolute; left: var(--sp-200); bottom: var(--sp-200);
  padding: var(--sp-50) var(--sp-100);
  background: rgba(255, 249, 239, 0.8); border-radius: var(--r-full);
  color: var(--muted); pointer-events: none;
}

@media (max-width: 767px) {
  .hero { padding-top: var(--sp-800); gap: var(--sp-400); }
  .hero-text { margin-top: var(--sp-300); gap: var(--sp-200); }
  .scene { height: 420px; aspect-ratio: auto; border-radius: var(--r-2xl); }
}

/* Движение в сцене */
.cloud { animation: drift 46s ease-in-out infinite alternate; }
.cloud.c2 { animation-duration: 62s; animation-delay: -12s; }
.cloud.c3 { animation-duration: 54s; animation-delay: -30s; }
@keyframes drift { from { transform: translateX(-90px); } to { transform: translateX(110px); } }

.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5.5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-0.5deg) translateX(-2px); } to { transform: rotate(0.6deg) translateX(3px); } }

.fall { animation: fall 16s linear infinite; opacity: 0; }
@keyframes fall {
  0% { transform: translate(0, -40px) rotate(0deg); opacity: 0; }
  8% { opacity: 0.9; }
  50% { transform: translate(60px, 300px) rotate(160deg); }
  92% { opacity: 0.9; }
  100% { transform: translate(-30px, 700px) rotate(330deg); opacity: 0; }
}

.sun-ring { animation: breathe 7s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { from { transform: scale(0.96); } to { transform: scale(1.06); } }

.bird { cursor: pointer; }

/* ===== Карточки ===== */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-300); }
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-100);
  padding: var(--sp-300);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl);
  transition: transform 500ms var(--ease), background-color 300ms var(--ease);
}
.card:hover { transform: translateY(-4px); background: #FFFCF6; }
.card p { color: var(--muted); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--r-full);
  background: var(--bg-sand); color: var(--brown); font-size: 24px;
}
@media (max-width: 767px) { .cards { grid-template-columns: 1fr; gap: var(--sp-200); } }

/* ===== Галерея ===== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-300); }
.shot { display: flex; flex-direction: column; gap: var(--sp-100); }
.shot img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--r-2xl); border: 1px solid var(--line);
  transition: transform 500ms var(--ease);
}
.shot:hover img { transform: scale(1.02) rotate(-0.4deg); }
.shot p { color: var(--muted); }
.shot-wide { grid-column: span 2; }
.shot-wide img { aspect-ratio: 16 / 10; }
@media (max-width: 767px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: var(--sp-200); }
  .shot-wide { grid-column: span 2; }
}

/* ===== Слоган ===== */
.tagline-section { padding: var(--sp-900) 0; }
.tagline { max-width: 680px; margin: 0 auto; }
.tagline .w { color: var(--ink-soft); transition: color 600ms var(--ease); }
.tagline .w.on { color: var(--ink); }
@media (min-width: 768px) { .tagline-section { padding: calc(var(--sp-900) + var(--sp-400)) 0; } }

/* ===== Игра ===== */
.game { display: flex; flex-direction: column; gap: var(--sp-300); }
.stage { padding: var(--sp-75); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl); }
.pan { border-radius: var(--r-2xl); overflow: hidden; -webkit-overflow-scrolling: touch; }
.pan.zoomed { overflow: auto; max-height: 78vh; }
.canvas { position: relative; width: 100%; line-height: 0; cursor: crosshair; transition: width 500ms var(--ease); touch-action: manipulation; }
.canvas.zoomed { width: 220%; }
.game-img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.game-answer { position: absolute; inset: 0; opacity: 0; transition: opacity 500ms var(--ease); pointer-events: none; }
.canvas.checked .game-answer { opacity: 1; }
.canvas.checked { cursor: default; }

.marks { position: absolute; inset: 0; }
.mark {
  position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  border: 3px solid #fff; border-radius: var(--r-full);
  background: rgba(90, 58, 39, 0.55); box-shadow: 0 0 0 2px var(--cocoa);
  padding: 0; cursor: pointer;
  animation: pop 500ms var(--ease);
}
.mark:hover { background: rgba(181, 72, 58, 0.7); }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.canvas.checked .mark { width: 20px; height: 20px; margin: -10px 0 0 -10px; border-width: 2px; cursor: default; box-shadow: none; pointer-events: none; }
.canvas.checked .mark.hit { background: var(--ok); }
.canvas.checked .mark.miss { background: var(--bad); }

.game-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-200); }
.game-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-100); }

.result {
  padding: var(--sp-400);
  background: var(--cocoa); color: var(--bg);
  border-radius: var(--r-2xl);
  display: flex; flex-direction: column; gap: var(--sp-100);
  animation: pop 700ms var(--ease);
}
.result[hidden] { display: none; }
.result .eyebrow { color: var(--tan); }
.result-text { max-width: 680px; }
.result-note { color: var(--tan); }

@media (max-width: 767px) {
  .game-bar { flex-direction: column; align-items: stretch; }
  .game-buttons { flex-direction: column; }
  .game-buttons .btn { width: 100%; }
  .result { padding: var(--sp-300); }
  .canvas.zoomed { width: 260%; }
}

/* ===== История слова ===== */
.origin { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-700); align-items: center; }
.origin-text { display: flex; flex-direction: column; gap: var(--sp-200); }
.origin-text p:not(.eyebrow) { color: var(--muted); }
.origin-art { position: relative; padding-bottom: var(--sp-600); }
.origin-crow {
  width: 78%; aspect-ratio: 9 / 16; object-fit: cover; object-position: center;
  border-radius: var(--r-2xl); border: 1px solid var(--line);
  transform: rotate(-3deg);
  max-height: 480px; width: auto; max-width: 78%;
}
.origin-pin {
  position: absolute; right: 0; bottom: 0; width: 44%; max-width: 220px;
  aspect-ratio: 1; object-fit: cover; border-radius: var(--r-2xl);
  border: 1px solid var(--line); transform: rotate(4deg);
  animation: bob 4s ease-in-out infinite alternate;
}
@keyframes bob { from { transform: rotate(4deg) translateY(0); } to { transform: rotate(2deg) translateY(-8px); } }
@media (max-width: 767px) { .origin { grid-template-columns: 1fr; gap: var(--sp-400); } .origin-crow { max-height: 360px; } }

/* ===== Подвал ===== */
.footer { padding: var(--sp-500) 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-200); color: var(--muted); }
.footer-top { display: inline-flex; align-items: center; gap: var(--sp-50); text-decoration: none; }
.footer-top:hover { color: var(--ink); }

/* ===== Появление при прокрутке ===== */
.js [data-reveal] {
  opacity: 0; transform: translateY(32px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js [data-reveal].in { opacity: 1; transform: none; }
.js .card[data-reveal].in:hover { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none; transition: opacity 400ms linear; }
  .cloud, .sway, .fall, .sun-ring, .origin-pin { animation: none; }
  .fall { opacity: 0; }
  .btn:hover, .card:hover, .shot:hover img { transform: none; }
  .nav-panel li { transform: none; }
  .tagline .w { color: var(--ink); transition: none; }
}
