/* Сайт TERRASOL. Цвета и шрифты — из ТЗ для типографии (наклейки 95×140).
   Движение: всё, что скрыто до появления, скрыто только при работающем сценарии (класс .js на <html>),
   а при «уменьшить движение» в настройках устройства анимации выключены (см. конец файла). */
:root {
  --cream: #F7F1E6;
  --paper: #FCF8F0;
  --brown: #5A3A26;
  --brown-soft: #866A58;
  --text: #6B4B37;
  --line: #E3D7C4;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

img { height: auto; }

a { color: inherit; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.caps {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--brown);
  color: var(--cream);
  text-decoration: none;
}

.skip:focus { top: 12px; }

/* Знак: арка с восходящим солнцем, линиями */
.em, .emblem { fill: none; stroke: currentColor; stroke-width: 4; overflow: visible; }

.em .soft, .emblem .soft { opacity: .5; }

.star { width: 10px; height: 10px; fill: currentColor; flex: none; }

/* Шапка */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 241, 230, .95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: box-shadow .3s;
}

.top.scrolled { box-shadow: 0 10px 30px -22px rgba(90, 58, 38, .55); }

.top .wrap { display: flex; align-items: center; gap: 8px 24px; min-height: 60px; flex-wrap: wrap; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: .32em;
}

.brand .em { height: 32px; width: auto; stroke-width: 9; }

.nav { display: flex; gap: 24px; margin-left: auto; }

.nav a { position: relative; text-decoration: none; white-space: nowrap; padding: 8px 0; }

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }

.langs { display: flex; gap: 4px; padding-left: 20px; border-left: 1px solid var(--line); }

.langs a { text-decoration: none; padding: 6px 9px; border-radius: 999px; color: var(--brown-soft); transition: color .2s, background .2s; }

.langs a:hover { color: var(--brown); }

.langs a[aria-current] { background: var(--brown); color: var(--cream); }

/* Полоска шести цветов: заполняется по мере прокрутки страницы */
.strip { position: relative; display: flex; height: 4px; }

.strip i { flex: 1; }

.strip b { display: none; }

.js .strip b {
  display: block;
  position: absolute;
  inset: 0;
  background: rgba(247, 241, 230, .78);
  transform-origin: right;
  will-change: transform;
}

/* Подсказка «сайт есть на вашем языке» */
.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 9px 44px 9px 16px;
  position: relative;
  background: #EFE6D6;
  font-size: 14px;
  text-align: center;
}

.hint[hidden] { display: none; }

.hint a { padding: 5px 12px; border-radius: 999px; background: var(--brown); color: var(--cream); text-decoration: none; font-size: 11px; }

.hint button {
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--brown);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Первый экран */
.hero { padding: 44px 0 56px; overflow: hidden; }

.hero .wrap { display: grid; grid-template-columns: 1.08fr .92fr; gap: 32px; align-items: center; }

.hero-text { text-align: center; }

.hero-text .emblem { width: 108px; height: auto; margin: 0 auto; }

.hero-text .wm { width: min(340px, 76%); margin: 24px auto 0; }

.hero-text .tag { margin: 18px 0 30px; font-size: 10.5px; letter-spacing: .28em; }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  text-wrap: balance;
}

.lead { max-width: 520px; margin: 0 auto 28px; font-size: 17px; color: var(--text); text-wrap: pretty; }

.cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0; }

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 999px;
  border: 1.5px solid var(--brown);
  background: var(--brown);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: background .25s, color .25s, translate .25s var(--ease), box-shadow .25s;
}

.btn:hover { background: #432A1B; translate: 0 -2px; box-shadow: 0 12px 22px -14px rgba(90, 58, 38, .8); }

.btn.ghost { background: none; color: var(--brown); }

.btn.ghost:hover { background: var(--brown); color: var(--cream); }

/* Витрина: окно-арка, в котором продукты сменяют друг друга */
.show { position: relative; --c: var(--brown); color: var(--c); transition: color .9s; }

.burst {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 150%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, currentColor 11%, transparent) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side, #000 22%, transparent 74%);
  mask: radial-gradient(closest-side, #000 22%, transparent 74%);
  pointer-events: none;
}

.show-stack { position: relative; display: grid; }

.show-item {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  opacity: 0;
  scale: .95;
  pointer-events: none;
  transition: opacity .8s ease, scale .9s var(--ease);
}

.show-item.is-on { opacity: 1; scale: 1; pointer-events: auto; }

.show-item img { width: min(290px, 62%); filter: drop-shadow(0 24px 22px rgba(90, 58, 38, .2)); }

.show-name { margin-top: 20px; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; color: var(--c); }

.show-sub { margin-top: 8px; font-size: 11px; color: var(--brown); }

.show-dots { position: relative; display: flex; justify-content: center; gap: 2px; margin-top: 14px; }

.show-dots button { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }

.show-dots button::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--c);
  opacity: .35;
  transition: opacity .3s, scale .3s var(--ease);
}

.show-dots button.is-on::before { opacity: 1; scale: 1.5; }

/* Бегущая строка */
.ticker { overflow: hidden; padding: 13px 0; background: var(--brown); color: var(--cream); }

.ticker-track { display: flex; width: max-content; }

.ticker-track > div { display: flex; }

.ticker span {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding-right: 24px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.ticker .star { opacity: .6; }

/* Разделы */
section { padding: 64px 0; scroll-margin-top: 64px; }

.tinted { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sec-head { text-align: center; margin-bottom: 38px; }

.sec-head .caps { color: var(--brown-soft); }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
  margin: 8px 0 0;
}

.center { text-align: center; max-width: 620px; margin: 0 auto; }

.mail-line { margin-top: 14px; }

/* Карточки продуктов — как лицевая наклейка */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.card {
  --c: var(--brown);
  display: flex;
  flex-direction: column;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  scroll-margin-top: 84px;
  transition: transform .4s var(--ease), box-shadow .4s, opacity .7s ease, translate .7s var(--ease);
}

.card:hover { transform: translateY(-6px); box-shadow: 0 26px 40px -26px rgba(90, 58, 38, .55); }

.card:target { box-shadow: 0 0 0 2px var(--c), 0 26px 40px -26px rgba(90, 58, 38, .55); }

.card .band {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 15px 10px;
  background: var(--c);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .34em;
}

.card .band .em { height: 22px; width: auto; stroke-width: 11; }

.card .pic { padding: 26px 20px 0; }

.card .pic img { width: 70%; margin: 0 auto; transition: scale .7s var(--ease); }

.card:hover .pic img { scale: 1.05; }

.card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  margin: 14px 14px 8px;
  color: var(--c);
}

.card p { margin: 0 14px; }

.card .pack { margin-top: -4px; margin-bottom: 8px; font-size: 12.5px; color: var(--brown-soft); }

.card .sub, .card .extra, .card .nosugar { font-size: 11px; }

.card .extra { margin-top: 6px; }

.card .nosugar { margin-top: 8px; color: var(--c); }

.card .foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: auto 22px 0;
  padding-top: 12px;
  border-top: 1px solid var(--brown);
}

.card .spacer { height: 18px; flex: none; }

.card .foot .origin { font-size: 10px; }

.card .foot .w { font-family: var(--serif); font-weight: 700; font-size: 24px; }

.card .buy { margin: 16px 22px 22px; }

.card .buy a, .card .buy span {
  display: block;
  padding: 12px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--c);
  color: var(--c);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: background .25s, color .25s;
}

.card .buy a:hover { background: var(--c); color: var(--cream); }

.card .buy span { border-style: dashed; opacity: .75; }

/* Три коротких факта */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.fact { position: relative; padding-top: 21px; }

.fact::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--c, var(--brown));
  transform-origin: left;
}

.fact h3, .recipe h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.25; margin: 0 0 8px; }

.fact p, .recipe p { margin: 0; color: var(--text); }

/* Рецепты: значки как на наклейке */
.recipes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.recipe {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.recipe h3 { color: var(--c, var(--brown)); }

.ico {
  width: min(250px, 100%);
  height: auto;
  margin: 0 0 18px;
  fill: none;
  stroke: var(--c, var(--brown));
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ico text {
  fill: var(--c, var(--brown));
  stroke: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10.5px;
  text-anchor: middle;
}

.ico-week .day path { fill: var(--c, var(--brown)); }

.ico-week text { fill: var(--cream); }

/* Контакты */
.mail { font-family: var(--serif); font-size: clamp(22px, 4vw, 30px); text-decoration: none; border-bottom: 1.5px solid var(--brown); }

/* Подвал */
.bottom { background: var(--brown); color: var(--cream); text-align: center; padding: 48px 0 40px; }

.foot-logo .em { width: 58px; height: auto; margin: 0 auto; stroke-width: 5; }

.foot-logo img { width: 200px; margin: 16px auto 0; }

.foot-nav, .foot-langs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; }

.foot-nav a, .foot-langs a { text-decoration: none; opacity: .85; font-size: 11px; }

.foot-nav a:hover, .foot-langs a:hover { opacity: 1; }

.foot-langs { margin-top: 14px; }

.foot-langs a[aria-current] { opacity: 1; border-bottom: 1px solid currentColor; }

.bottom p { margin: 26px 0 0; opacity: .7; font-size: 11px; }

/* Кнопка «наверх» */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 15;
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(247, 241, 230, .55);
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 10px 24px -10px rgba(90, 58, 38, .8);
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
  transition: opacity .3s, translate .3s var(--ease);
}

.js .totop { display: grid; }

.totop.on { opacity: 1; translate: 0 0; pointer-events: auto; }

.totop svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Страница 404 */
.nf main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }

.nf .em { width: 84px; height: auto; }

.nf h1 { font-size: 64px; margin: 18px 0 10px; }

.nf p { margin: 6px 0; color: var(--text); }

.nf strong { color: var(--brown); }

/* Пометки черновика: на опубликованный сайт не попадают */
.draft-banner { background: #A8482A; color: #fff; text-align: center; font-size: 13px; padding: 8px 14px; }

.todo {
  margin: 14px auto 0;
  max-width: 620px;
  border: 1.5px dashed #B86A55;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  color: #8A3A22;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 12px;
  text-align: left;
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; }
  .show { width: min(400px, 100%); margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; gap: 22px; }
  .recipes { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav { order: 3; width: 100%; margin-left: 0; gap: 0; justify-content: space-between; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .langs { margin-left: auto; padding-left: 0; border-left: 0; }
  .nav .caps { font-size: 10.5px; letter-spacing: .1em; }
  section { padding: 48px 0; scroll-margin-top: 100px; }
  .card { scroll-margin-top: 116px; }
  .hero { padding: 34px 0 44px; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
  .hero-text .emblem { width: 92px; }
  .hero-text .tag { font-size: 9px; letter-spacing: .18em; white-space: nowrap; }
  .show-name { font-size: 28px; }
  .recipe { padding: 18px; }
}

/* ── Движение. Только если устройство не просит его уменьшить. ── */
@media (prefers-reduced-motion: no-preference) {
  /* Появление при прокрутке */
  .js [data-reveal] { opacity: 0; translate: 0 24px; transition: opacity .7s ease var(--d, 0s), translate .7s var(--ease) var(--d, 0s); }
  .js [data-reveal].in { opacity: 1; translate: 0 0; }
  .js .card[data-reveal] { transition: transform .4s var(--ease), box-shadow .4s, opacity .7s ease var(--d, 0s), translate .7s var(--ease) var(--d, 0s); }
  .js .fact::before { transform: scaleX(0); transition: transform .9s var(--ease) calc(var(--d, 0s) + .15s); }
  .js .fact.in::before { transform: scaleX(1); }

  /* Восход в знаке: арка рисуется, солнце встаёт, расходятся лучи */
  .js .rise .arch { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s cubic-bezier(.6, 0, .2, 1) .1s forwards; }
  .js .rise .arch.in { animation-delay: .3s; }
  .js .rise .hz { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .7s ease-out 1s forwards; }
  .js .rise .ground { opacity: 0; animation: appear .8s ease-out 1.3s forwards; }
  .js .rise .soft { opacity: 0; animation: appear-soft .8s ease-out 1.5s forwards; }
  .js .rise .sun { transform: translateY(56px); animation: sunrise 1.7s var(--ease) 1.3s forwards; }
  .js .rise .ray {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw .6s ease-out calc(2.1s + var(--i) * .1s) forwards, shimmer 6s ease-in-out calc(4s + var(--i) * .35s) infinite;
  }

  /* Тексты первого экрана выходят следом */
  .js .hero-text > :not(.emblem) { opacity: 0; translate: 0 14px; animation: rise-in .8s var(--ease) forwards; }
  .js .hero-text .wm { animation-delay: .7s; }
  .js .hero-text .tag { animation-delay: .95s; }
  .js .hero-text h1 { animation-delay: 1.2s; }
  .js .hero-text .lead { animation-delay: 1.4s; }
  .js .hero-text .cta { animation-delay: 1.6s; }
  .js .show { opacity: 0; animation: appear 1.1s ease-out .9s forwards; }

  .burst { animation: spin 150s linear infinite; }
  .show-item.is-on img { animation: float 6.5s ease-in-out infinite; }
  .ticker-track { animation: ticker 46s linear infinite; }
  .ticker:hover .ticker-track { animation-play-state: paused; }

  /* Значки рецептов оживают, когда до них докрутили */
  .ico-kompot.in .steam { animation: steam 2.6s ease-in-out calc(var(--i) * .45s) infinite; }
  .js .ico-kompot .bag { opacity: 0; translate: 0 8px; transition: opacity .5s ease calc(.2s + var(--i) * .18s), translate .5s var(--ease) calc(.2s + var(--i) * .18s); }
  .js .ico-kompot.in .bag { opacity: 1; translate: 0 0; }
  .ico-kompot.in .arrow { animation: nudge 1.8s ease-in-out 1s infinite; }
  .ico-week.in .day { animation: day 6.3s ease-in-out calc(var(--i) * .55s) infinite; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { width: auto; flex-wrap: wrap; justify-content: center; }
  .ticker-track > div + div { display: none; }
  .ticker-track > div { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
}

@keyframes draw { to { stroke-dashoffset: 0; } }

@keyframes appear { to { opacity: 1; } }

@keyframes appear-soft { to { opacity: .5; } }

@keyframes sunrise { to { transform: translateY(0); } }

@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

@keyframes rise-in { to { opacity: 1; translate: 0 0; } }

@keyframes spin { to { rotate: 360deg; } }

@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

@keyframes ticker { to { transform: translateX(-50%); } }

@keyframes steam { 0% { opacity: 0; translate: 0 4px; } 40% { opacity: 1; } 100% { opacity: 0; translate: 0 -7px; } }

@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 4px 0; } }

@keyframes day { 0%, 100% { opacity: .28; } 9%, 62% { opacity: 1; } 76% { opacity: .28; } }
