/* Музей учебных вещей — зелёная доска, мел, настоящие предметы */
:root {
  --board: #213d29;
  --board-deep: #1a3121;
  --chalk: #f3f0e6;
  --chalk-2: rgba(243, 240, 230, .74);
  --chalk-3: rgba(243, 240, 230, .48);
  --line: rgba(243, 240, 230, .2);
  --mint: #9fe6c0;
  --amber: #f2c46b;
  --red: #ff7a68;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --gut: clamp(16px, 3.4vw, 48px);
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--board);
  background-image:
    radial-gradient(1200px 700px at 15% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 600px at 100% 40%, rgba(255,255,255,.035), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color: var(--chalk);
  font: 400 18px/1.55 var(--sans);
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--mint); color: var(--board-deep); }

/* ───────── Главная ───────── */
.hero { max-width: 1440px; margin: 0 auto; padding: clamp(32px, 6vw, 80px) var(--gut) clamp(8px, 2vw, 24px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px 48px; align-items: end; }
.hero__kicker { grid-column: 1 / -1; font: 600 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--chalk-3); margin: 0 0 6px; }
.hero__title { margin: 0; font-weight: 900; letter-spacing: -.035em; font-size: clamp(48px, 8.4vw, 132px); line-height: .9; }
.hero__lead { margin: 0 0 8px; font-size: clamp(17px, 1.5vw, 21px); color: var(--chalk-2); text-wrap: pretty; }

.board { max-width: 1440px; margin: 0 auto; padding: clamp(8px, 2vw, 24px) var(--gut) clamp(24px, 4vw, 56px); overflow-x: clip; overflow-clip-margin: 0; }

/* Строка предметов: 12 колонок, у каждого своя ширина */
.row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2.4vw, 40px);
  align-items: center;
  margin-bottom: clamp(40px, 5vw, 80px);
}
.row--3 { align-items: end; }
.row--1 { justify-items: center; }
.row--1 .tile { grid-column: 2 / span var(--span); }

.tile { grid-column: span var(--span); display: flex; flex-direction: column; align-items: center; position: relative; text-decoration: none; outline: none; }
.tile__box { position: relative; display: block; transform: rotate(var(--tilt, 0)); max-width: 100%; }
.tile__frame {
  position: absolute; inset: -5%; width: 110%; height: 110%; overflow: visible;
  fill: none; stroke: var(--chalk); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  opacity: .7; transition: stroke-dashoffset .9s cubic-bezier(.5, 0, .2, 1);
  filter: url(#chalk);
}
.tile__img {
  display: block; width: auto; height: auto; max-width: 100%;
  max-height: min(calc(var(--mh) * 1vw), calc(var(--mh) * 14.4px));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .5s;
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.32));
  animation: float 7s ease-in-out infinite;
}
.tile:nth-child(2) .tile__img { animation-delay: -2.3s; }
.tile:nth-child(3) .tile__img { animation-delay: -4.6s; }
@keyframes float { 50% { translate: 0 -5px; } }

/* Подпись: мелом под предметом, проявляется при наведении */
.tile__label {
  display: flex; gap: 12px; align-items: baseline; justify-content: center;
  margin-top: 14px; pointer-events: none;
  opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s;
}
.tile__name { font: 600 clamp(16px, 1.4vw, 21px)/1.2 var(--sans); }
.tile__year { font: 700 clamp(19px, 1.6vw, 24px)/1 var(--hand); color: var(--mint); }
.tile--l .tile__name { font-size: clamp(20px, 2vw, 30px); }

.tile:hover .tile__img, .tile:focus-visible .tile__img { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 28px 32px rgba(0,0,0,.4)) drop-shadow(0 0 30px rgba(159,230,192,.2)); }
.tile:hover .tile__frame, .tile:focus-visible .tile__frame { stroke-dashoffset: 0; }
.tile:hover .tile__label, .tile:focus-visible .tile__label { opacity: 1; transform: none; }

/* Строка-фактоид: пауза между рядами предметов */
.fact {
  display: grid; grid-template-columns: auto minmax(0, 26ch); gap: 0 clamp(16px, 3vw, 40px); align-items: center;
  margin: 0 0 clamp(40px, 5vw, 80px);
  padding: 0 0 0 4%; text-decoration: none; width: fit-content;
}
.fact--right { margin-left: auto; padding: 0 4% 0 0; }
.fact__num { font-weight: 900; letter-spacing: -.05em; line-height: .85; font-size: clamp(88px, 15vw, 230px); color: var(--chalk); transition: color .2s; }
.fact__text { font: 600 clamp(22px, 2.3vw, 34px)/1.15 var(--hand); color: var(--chalk-2); text-wrap: balance; }
.fact:hover .fact__num, .fact:focus-visible .fact__num { color: var(--mint); }

@media (hover: none) {
  .tile__label { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .tile { grid-column: span 1; }
  .tile--l { grid-column: span 2; }
  .row--3 .tile--m:last-child { grid-column: span 2; }
  .tile__img { max-height: calc(var(--mh) * 2.2vw); }
  .tile__label { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
  .fact { grid-template-columns: 1fr; padding: 0; }
  .fact__num { font-size: 96px; }
}

.foot { max-width: 1440px; margin: 0 auto; padding: 40px var(--gut) 64px; color: var(--chalk-3); font-size: 15px; border-top: 1px dashed var(--line); }
.foot p { margin: 0 0 6px; max-width: 760px; }

/* ───────── Экспонат ───────── */
.crumbs { max-width: 1320px; margin: 0 auto; padding: 22px var(--gut); }
.back { display: inline-block; font-weight: 600; font-size: 15px; color: var(--chalk); text-decoration: none; border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; transition: background .2s; }
.back:hover { background: rgba(255,255,255,.08); }

.ex-hero { max-width: 1320px; margin: 0 auto; padding: 0 var(--gut) clamp(32px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(16px, 4vw, 64px); align-items: center; }
.ex-hero__stage { position: relative; }
.ex-hero__stage::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(159,230,192,.2), transparent); filter: blur(10px); }
.ex-hero__stage img { position: relative; width: 100%; height: auto; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }
.ex-hero__year { margin: 0; font: 700 clamp(30px, 3.4vw, 46px)/1 var(--hand); color: var(--mint); transform: rotate(-3deg); transform-origin: left; }
.ex-hero__title { margin: 10px 0 0; font-size: clamp(44px, 7vw, 104px); font-weight: 900; letter-spacing: -.035em; line-height: .92; text-wrap: balance; }
.ex-hero__lead { margin: 24px 0 0; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.45; color: var(--chalk-2); text-wrap: pretty; }
.ex-hero__arrow { margin: 26px 0 0; display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; font-size: 16px; color: var(--chalk-3); }
.ex-hero__arrow span { color: var(--chalk); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.ex-hero__arrow span:last-child { color: var(--board-deep); background: var(--mint); border-color: var(--mint); }

/* Проблема: сцена + текст + ответ */
.problem {
  max-width: 1320px; margin: 0 auto clamp(56px, 8vw, 104px); padding: 0 var(--gut);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3.5vw, 56px); align-items: center;
}
.problem__scene { margin: 0; }
.problem__scene img { width: 100%; height: auto; filter: drop-shadow(0 24px 36px rgba(0,0,0,.35)); }
.problem__label { margin: 0 0 12px; font: 700 clamp(30px, 3vw, 40px)/1 var(--hand); color: var(--red); transform: rotate(-2deg); transform-origin: left; }
.problem__text p:not(.problem__label) { margin: 0 0 14px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; text-wrap: pretty; }
.problem__answer { grid-column: 1 / -1; position: relative; padding: clamp(22px, 3vw, 36px) clamp(22px, 3.5vw, 44px); }
.problem__answer::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 2px solid var(--chalk); border-radius: 6px 14px 8px 18px / 16px 6px 14px 8px; filter: url(#chalk); }
.problem__answer .problem__label { color: var(--mint); }
.problem__answer p:not(.problem__label) { margin: 0; font-size: clamp(22px, 2.5vw, 34px); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }

/* Как менялась вещь */
.evo { max-width: 1320px; margin: 0 auto clamp(56px, 8vw, 104px); padding: 0 var(--gut); }
.evo__title { margin: 0 0 clamp(16px, 2.5vw, 32px); font-size: clamp(30px, 4vw, 56px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.evo__row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.evo__step { position: relative; }
.evo__step + .evo__step::before { content: "→"; position: absolute; left: calc(-1 * clamp(12px, 2vw, 28px) / 2); top: 22%; transform: translateX(-50%); font: 700 30px/1 var(--hand); color: var(--chalk-3); }
.evo__step img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 16px 22px rgba(0,0,0,.3)); transition: transform .4s; }
.evo__step:hover img { transform: translateY(-6px) rotate(-1.5deg); }
.evo__when { margin: 10px 0 2px; font: 700 26px/1 var(--hand); color: var(--mint); }
.evo__name { margin: 0 0 6px; font-size: 20px; font-weight: 800; line-height: 1.2; }
.evo__text { margin: 0; font-size: 16px; line-height: 1.45; color: var(--chalk-2); text-wrap: pretty; }
.evo__step--cur .evo__name::after { content: " · в музее"; font-weight: 500; font-size: 14px; color: var(--chalk-3); }

/* История */
.ex-body { max-width: 980px; margin: 0 auto; padding: 0 var(--gut); }
.ex-body p { margin: 0 0 14px; text-wrap: pretty; }
.ex-body p:last-child { margin-bottom: 0; }
.sec-title { margin: 0 0 22px; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--chalk-3); }
.story { margin-bottom: clamp(48px, 7vw, 88px); }
.beat { display: grid; grid-template-columns: 160px 1fr; gap: 32px; padding-bottom: 40px; }
.beat__when { margin: 0; font: 700 30px/1.05 var(--hand); color: var(--mint); text-align: right; padding-top: 2px; }
.beat__who { margin: 0 0 4px !important; font-size: 14px; font-weight: 600; color: var(--amber); letter-spacing: .02em; }
.beat__title { margin: 0 0 10px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.beat__body p { color: var(--chalk-2); }
.beat__body em { color: var(--chalk); font-style: normal; border-bottom: 1px dashed var(--chalk-3); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); }
.card { background: rgba(0,0,0,.14); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; }
.card p { color: var(--chalk-2); font-size: 17px; }
.card--online { background: rgba(159,230,192,.07); border-color: rgba(159,230,192,.3); }
.card--online .sec-title { color: var(--mint); }

.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; margin-bottom: clamp(40px, 6vw, 64px); }
.num b { display: block; font-size: clamp(30px, 3.6vw, 48px); text-wrap: balance; font-weight: 900; letter-spacing: -.03em; line-height: 1; margin-bottom: 8px; }
.num span { display: block; color: var(--chalk-3); font-size: 15px; line-height: 1.4; }

.src { margin-bottom: 40px; font-size: 14px; color: var(--chalk-3); }
.src summary { cursor: pointer; font-weight: 600; }
.src ol { margin: 12px 0 0; padding-left: 22px; }
.src li { margin-bottom: 6px; overflow-wrap: anywhere; }
.src a { color: var(--chalk-2); }

.pager { max-width: 1320px; margin: 0 auto; padding: 24px var(--gut) 64px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px dashed var(--line); }
.pager__a { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; color: var(--chalk-2); transition: color .2s; }
.pager__a:hover { color: var(--chalk); }
.pager__a img { width: 72px; height: 72px; object-fit: contain; transition: transform .3s; }
.pager__a:hover img { transform: scale(1.1) rotate(-4deg); }
.pager__a--next { text-align: right; }

@media (max-width: 860px) {
  .ex-hero, .problem { grid-template-columns: 1fr; }
  .ex-hero__stage { max-width: 420px; margin: 0 auto; }
  .evo__row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 calc(-1 * var(--gut)); padding-left: var(--gut); padding-right: var(--gut); }
  .evo__step { scroll-snap-align: start; }
  .evo__step + .evo__step::before { display: none; }
  .two { grid-template-columns: 1fr; }
  .beat { grid-template-columns: 1fr; gap: 4px; }
  .beat__when { text-align: left; }
  .pager__a span { font-size: 14px; }
  .pager__a img { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
