/* Аудиогид «Крокус Сити Океанариум».
   Палитра из логотипа: синий — текст и акценты, оранжевый — главное действие.
   Шапка белая: у логотипа белый фон, на цветной он дал бы прямоугольник. */

:root {
  --blue-deep: #1F3C88;
  --blue: #3E6FB7;
  --blue-light: #29A8DF;
  --orange: #F07F13;
  --orange-dark: #E2560E;

  --ink: #16233f;
  --ink-soft: #5b6782;
  --paper: #ffffff;
  --paper-soft: #f2f5fa;
  --line: #dde4ef;

  --gutter: 16px;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}

h1, h2 { line-height: 1.2; margin: 0; }

/* Страница уже уходит на лендинг за кодом (скрипт в <head>): не мигаем ею. */
html[data-locked] body { display: none; }

/* --- Шапка страницы аквариума ------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px var(--gutter);
  padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar__home { display: flex; }
.bar__home img { display: block; height: 40px; width: auto; }
.bar__time {
  position: absolute;
  right: var(--gutter);
  bottom: 16px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--paper-soft);
  color: var(--blue-deep);
  border-radius: 99px;
  padding: 3px 9px;
}
.bar__time[data-urgent] { background: var(--orange-dark); color: #fff; }

/* --- Экран аквариума ----------------------------------------------------- */

.exhibit { padding: 20px var(--gutter) 0; max-width: 640px; margin: 0 auto; }
.exhibit__kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.exhibit__title { font-size: 28px; color: var(--blue-deep); }

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 99px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 13px;
  border: 1px solid #ffd9a8;
}

/* --- Плеер: главный элемент экрана ------------------------------------- */

.player { margin: 22px 0 8px; }

.player__play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.player__play:active { background: var(--orange-dark); }

.player__icon { width: 26px; height: 26px; fill: currentColor; flex: none; }
.player__icon--pause { display: none; }
[data-state="playing"] .player__icon--play { display: none; }
[data-state="playing"] .player__icon--pause { display: block; }

.player__track { margin-top: 14px; }

.player__seek {
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 28px;
}
.player__seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(var(--blue-light), var(--blue-light)) no-repeat var(--line);
  background-size: var(--progress, 0%) 100%;
}
.player__seek::-moz-range-track { height: 5px; border-radius: 3px; background: var(--line); }
.player__seek::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--blue-light); }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: -7px;
  border-radius: 50%; background: var(--blue-light); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.player__seek::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue-light); border: 2px solid #fff;
}

.player__times {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-top: -2px;
}

.player__hint { font-size: 14px; color: var(--ink-soft); margin: 12px 0 0; }
.player__hint--error { color: var(--orange-dark); }

/* --- Факты и текст ----------------------------------------------------- */

.facts { margin: 24px 0 0; border-top: 1px solid var(--line); }
.facts__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.facts__label { color: var(--ink-soft); }
.facts__value { font-weight: 600; text-align: right; }

.text { margin: 26px 0 0; }
.text p { margin: 12px 0 0; }

.credits { margin: 24px 0 0; font-size: 13px; color: var(--ink-soft); }

/* --- Переходы по маршруту ---------------------------------------------- */

.next {
  display: flex;
  gap: 10px;
  padding: 26px var(--gutter) 0;
  max-width: 640px;
  margin: 0 auto;
}
.next__link {
  flex: 1;
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--paper-soft);
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 600;
}
.next__link--prev { flex: 0 0 auto; }
.next__kicker { display: block; font-size: 12px; font-weight: 400; color: var(--ink-soft); }

/* --- Подвал ------------------------------------------------------------ */

/* Нижний отступ — под кнопку сканера: она висит поверх и не должна закрывать
   последние строки. */
.foot {
  padding: 24px var(--gutter);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}

.langs { display: flex; justify-content: center; gap: 6px; }
.langs__item {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.langs__item[aria-current="true"] {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: #fff;
}

/* --- Сканер QR ---------------------------------------------------------- */

/* Кнопка всегда под большим пальцем: к следующему аквариуму подходят с
   открытой страницей предыдущего, и листать текст до конца ради сканера никто
   не станет. Синяя, а не оранжевая — оранжевый остаётся за Play. */
.scan-open {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 99px;
  background: var(--blue-deep);
  color: #fff;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(22, 35, 63, .3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scan-open:active { background: var(--blue); }
.scan-open svg { width: 22px; height: 22px; fill: currentColor; flex: none; }

.scan {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 30;
  background: #000;
  color: #fff;
}
.scan[hidden], .scan [hidden] { display: none; }

.scan__view { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; }
.scan__video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Рамку области сканирования рисует библиотека, цвет задан у неё в style. */
.scan-region-highlight-svg { stroke: #fff !important; }

.scan__hint {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  left: 0; right: 0;
  margin: 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}

.scan__error {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 28px;
  background: #000;
  text-align: center;
}
.scan__error p { margin: 0; }

.scan__bar {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 12px;
}
.scan__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scan__btn--icon { padding: 0; }
.scan__btn svg { width: 24px; height: 24px; fill: currentColor; }

/* --- Лендинг ----------------------------------------------------------- */

.hero {
  padding: calc(28px + env(safe-area-inset-top)) var(--gutter) 22px;
  text-align: center;
}
.hero__logo { display: block; margin: 0 auto 10px; height: 96px; width: auto; }
.hero__title { font-size: 20px; font-weight: 600; color: var(--blue-deep); }

.home__main {
  padding: 0 var(--gutter) calc(96px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}
.home__main .langs { margin-top: 28px; }

.access {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.access__pane { display: none; }
.access[data-state="need-code"] [data-when="need-code"],
.access[data-state="checking"] [data-when="checking"],
.access[data-state="valid"]    [data-when="valid"],
.access[data-state="offline"]  [data-when="offline"] { display: block; }

.access__heading { font-size: 18px; color: var(--blue-deep); }
.access__note { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.access__status { margin: 0; font-size: 16px; font-weight: 600; }
.access__status--ok { color: #17803d; }
.access__error { margin: 8px 0 0; font-size: 14px; color: var(--orange-dark); }

.access__form { display: flex; gap: 8px; margin-top: 12px; }
.access__input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.access__input:focus { outline: 2px solid var(--blue-light); outline-offset: 1px; }
.access__submit {
  flex: none;
  padding: 13px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue-deep);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.access__submit:active { background: var(--blue); }

/* Вступление и прощание: не аквариумы, но такие же дорожки. */
.track-card {
  display: block;
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius);
  text-decoration: none;
}
.track-card--intro {
  background: var(--blue-deep);
  color: #fff;
}
.track-card--outro {
  background: none;
  border: 1px solid var(--line);
  color: var(--blue-deep);
}
.track-card__kicker {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .75;
}
.track-card__title { display: block; font-size: 19px; font-weight: 600; margin-top: 3px; }
.track-card__meta { display: block; font-size: 13px; opacity: .75; margin-top: 2px; }

.expositions { margin-top: 32px; }
.expositions__heading { font-size: 15px; color: var(--ink-soft); font-weight: 600; }

.exposition {
  display: block;
  margin-top: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--paper-soft);
  color: var(--blue-deep);
  text-decoration: none;
}
.exposition__title { display: block; font-size: 18px; font-weight: 600; }
.exposition__meta { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
