/* Оболонка «Машини часу»: шкала років і сцена.
   Навмисно поза епохами — нейтральна, темна, монопросторова.
   Стилі самих епох живуть в assets/era/*.css і заскоуплені [data-era="…"]. */

:root {
  --shell-bg: #0b0d10;
  --shell-fg: #e7ecef;
  --shell-dim: #8b97a1;
  --shell-line: #232a31;
  --shell-accent: #4ade80;
  --shell-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --shell-h: 116px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--shell-bg);
}

body {
  margin: 0;
  background: var(--shell-bg);
  color: var(--shell-fg);
  font-family: var(--shell-mono);
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--shell-fg);
  color: var(--shell-bg);
}
.skip:focus {
  left: 8px;
  top: 8px;
}

/* ── Шкала років ─────────────────────────────────────────────── */

.tm {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.94);
  border-bottom: 1px solid var(--shell-line);
  backdrop-filter: blur(8px);
}

.tm__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px 12px;
}

.tm__top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.tm__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tm__hint {
  margin: 0;
  font-size: 11px;
  color: var(--shell-dim);
}

.tm__about {
  font-size: 11px;
}
.tm__about summary {
  cursor: pointer;
  color: var(--shell-dim);
  list-style: none;
}
.tm__about summary::-webkit-details-marker {
  display: none;
}
.tm__about summary:hover,
.tm__about summary:focus-visible {
  color: var(--shell-fg);
}
.tm__about p {
  position: absolute;
  right: 16px;
  z-index: 5;
  max-width: 420px;
  margin: 8px 0 0;
  padding: 12px 14px;
  background: #11151a;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  color: var(--shell-dim);
  line-height: 1.55;
}

.tm__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tm__years {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: max-content;
  margin: 0;
  padding: 0 0 2px;
  list-style: none;
}

.tm__item {
  display: flex;
  align-items: center;
}

.tm__btn {
  position: relative;
  display: block;
  padding: 7px 14px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--shell-dim);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.18s, background-color 0.18s, border-color 0.18s;
}
.tm__btn:hover {
  color: var(--shell-fg);
  background: #161b21;
}
.tm__btn:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}
.tm__btn[aria-current="true"] {
  color: var(--shell-bg);
  background: var(--shell-accent);
  border-color: var(--shell-accent);
  font-weight: 700;
}

.tm__rail {
  width: 26px;
  height: 1px;
  background: var(--shell-line);
}

/* перемикач мов */
.tm__langs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
}
.tm__lang {
  padding: 4px 11px 5px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--shell-dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.18s, background-color 0.18s;
}
.tm__lang:hover {
  color: var(--shell-fg);
  background: #161b21;
}
.tm__lang:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}
.tm__lang[aria-current="true"] {
  background: var(--shell-fg);
  color: var(--shell-bg);
  font-weight: 700;
}

.tm__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--shell-line);
  font-size: 11px;
  color: var(--shell-dim);
}
.tm__era-name {
  color: var(--shell-fg);
}
.tm__tech {
  opacity: 0.75;
}

/* ── Сцена ───────────────────────────────────────────────────── */

/* Прокрутку по горизонталі тримає .era-fixed, а не сцена: інакше #stage стає
   scroll-контейнером і ламає sticky-шапки сучасних епох. */
#stage {
  margin-top: var(--shell-h);
  min-height: calc(100vh - var(--shell-h));
  background: #fff;
  color: #111;
  font-family: system-ui, sans-serif;
  transition: opacity 0.22s ease;
}

#stage.is-swapping {
  opacity: 0;
}

/* Ретро-епохи навмисно неадаптивні — як і було: на вузькому екрані
   вони прокручуються вбік, а шкала років лишається на місці. */
.era-fixed {
  overflow-x: auto;
}
.era-fixed > * {
  min-width: var(--era-width, 760px);
}

/* Пастка для ботів — прибрана з очей і з фокусу, але не display:none,
   бо частина ботів такі поля ігнорує. */
.kweb-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.noscript {
  margin-top: var(--shell-h);
  padding: 32px 20px 60px;
  background: #fff;
  color: #111;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}
.noscript .noscript__inner {
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  :root {
    --shell-h: 128px;
  }
  .tm__about {
    margin-left: 0;
  }
  .tm__about p {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stage {
    transition: none;
  }
}
