@font-face {
  font-family: 'Forum';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/forum-cyrillic-400.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Forum';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/forum-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/golos-text-cyrillic-400.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/golos-text-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/golos-text-cyrillic-500.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/golos-text-latin-500.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/golos-text-cyrillic-600.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/golos-text-latin-600.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-400.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-cyrillic-500.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-latin-500.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#ECEAE4, #0E0E0D);
  --ink: light-dark(#121212, #ECEAE4);
  --accent: #E8480C;
  --muted: light-dark(#5A5852, #A3A098);
  --secondary: light-dark(#3A3935, #C9C6BE);
  --tag-line: light-dark(#A9A59C, #6B6963);
  --panel-bg: light-dark(#121212, #1A1A18);
  --panel-text: #ECEAE4;
  --panel-line: light-dark(#4A4944, #68665F);
  --panel-muted: light-dark(#A8A59D, #A3A098);
  --panel-secondary: light-dark(#B8B5AD, #C9C6BE);
  --panel-stamp-line: light-dark(var(--muted), var(--panel-line));
  --font-display: 'Forum', serif;
  --font-body: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --rule: 1px solid var(--ink);
  --gutter: 32px;
  --content-width: 1320px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

body {
  margin: 0;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

a { color: inherit; }

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--paper);
}

.filter:focus-visible,
.hero-open:focus-visible {
  outline-color: var(--ink);
  position: relative;
  z-index: 1;
}

.skip-link:focus-visible { outline-color: var(--ink); }

.skip-link {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 12px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(calc(-100% - 24px));
}

.skip-link:focus { transform: none; }

.mono { font-family: var(--font-mono); }

.display-type {
  font-family: var(--font-display);
  font-weight: 400;
}

.muted { color: var(--muted); }
.rule-top { border-top: var(--rule); }
.rule-bottom { border-bottom: var(--rule); }
.sheet { border: var(--rule); }

.dark-panel {
  position: relative;
  background: var(--panel-bg);
  color: var(--panel-text);
}

.dark-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-block: 1px solid light-dark(transparent, var(--panel-line));
  pointer-events: none;
}

.hatch {
  background: repeating-linear-gradient(45deg, var(--accent) 0 2px, var(--paper) 2px 7px);
}

.zones {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.zones span {
  padding: 3px 8px;
  font-size: 10px;
  color: var(--muted);
}

.zones span + span { border-left: var(--rule); }

.site-nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  font-weight: 500;
}

.brand-mark { fill: currentColor; }

.nav-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-inline-start: auto;
  padding-inline: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-open-short { display: none; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
}

.nav-links a { padding: 18px 14px; }

.language-links {
  display: flex;
  margin-inline-start: auto;
  padding-inline-start: 8px;
}

.language-links a { padding-inline: 6px; }

.site-nav .language-links a[aria-current="true"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.language-links a[aria-current="true"] .link-label::after { display: none; }

.theme-toggle {
  align-self: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:not([hidden]) {
  display: grid;
  place-items: center;
}

.theme-toggle [data-icon] { display: none; }
:root:not([data-theme]) .theme-toggle [data-icon="system"],
:root[data-theme="light"] .theme-toggle [data-icon="light"],
:root[data-theme="dark"] .theme-toggle [data-icon="dark"] { display: inline; }

:is(html[lang="en"], html[lang="de"]) main {
  hyphens: auto;
}

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 80px var(--gutter);
}

.section-flow {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 48px;
}

.section-head-split { row-gap: 16px; }

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  margin: 0;
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1;
  text-transform: uppercase;
}

.section-description {
  max-width: 460px;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--secondary);
}

.caption {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* Карта разработки */

.hero-inner {
  padding-block: 72px 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 56px;
}

.hero-copy {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero-title {
  margin: 0;
  font-size: clamp(44px, 5vw, 96px);
  line-height: 0.94;
  text-transform: uppercase;
}

.hero-description {
  max-width: 460px;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
}

.hero-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hero-open {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.hero-links a {
  padding: 10px 0;
  text-underline-offset: 5px;
}

.hero-stats {
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: var(--rule);
  font-size: 12px;
  line-height: 15px;
}

.hero-stats > div { padding: 12px 12px 0; }

.hero-stats > div + div { border-left: var(--rule); }
.hero-stats > div:first-child { padding-left: 0; }
.hero-stats > div:last-child { padding-right: 0; }

.hero-stats dt { color: var(--muted); }
.hero-stats dd { margin: 6px 0 0; }

.plan {
  flex: 1 1 560px;
  max-width: 600px;
  min-width: 0;
  margin: 0;
}

.plan-drawing {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 740;
}

.plan-drawing svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.plan-start {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.svg-ink { fill: var(--ink); }
.svg-paper { fill: var(--paper); }
.svg-muted { fill: var(--muted); }
.svg-ink-line { stroke: var(--ink); }
.svg-paper-line { stroke: var(--paper); }
.svg-accent-line { stroke: var(--accent); }

[data-course].is-selected { stroke-width: 2.5; }
[data-course].is-selected:not([data-course="1"]) { fill: var(--ink); }

[data-num].is-selected:not([data-num="1"]) {
  fill: var(--paper);
  stroke: var(--ink);
}

.phase {
  position: absolute;
  top: calc(var(--phase-height) - 25px);
  left: 57%;
  width: 43%;
}

.phase,
.phase-control {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0 0 6px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

[data-phase="VI"] { --phase-height: 18.02%; }
[data-phase="V"] { --phase-height: 32.43%; }
[data-phase="IV"] { --phase-height: 46.85%; }
[data-phase="III"] { --phase-height: 61.26%; }
[data-phase="II"] { --phase-height: 75.68%; }

.phase-foundation {
  --phase-height: 90.09%;
  gap: 0;
  cursor: auto;
}

.phase-control { gap: 6px; }

.phase-open {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 24px;
  font-size: 12px;
}

.phase-title {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 22px;
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phase-name {
  font-weight: 500;
  text-underline-offset: 4px;
}

.phase-tag {
  padding: 2px 6px;
  border: 1px solid var(--tag-line);
}

.phase-description {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

[data-phase][aria-pressed="true"] .phase-name { text-decoration: underline; }
[data-phase][aria-pressed="true"] .phase-description { color: var(--ink); }
.plan-caption { margin-top: 16px; }

/* Разрез платформы */

.layers {
  display: flex;
  flex-direction: column;
  border-top: var(--rule);
}

.layer {
  display: flex;
  flex-wrap: wrap;
  border-bottom: var(--rule);
}

.layer-label {
  flex: 0 0 200px;
  padding: 16px 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.layer-count {
  text-transform: none;
  letter-spacing: 0;
}

.layer-content { flex: 1 1 320px; }

.layer-stones,
.layer-spaces,
.layer-core {
  display: flex;
  flex-wrap: wrap;
}

.layer-stones,
.layer-id,
.layer-base,
.layer-spaces > span,
.layer-core > span { border-left: var(--rule); }

.layer-stones {
  align-items: flex-end;
  gap: 6px;
  padding: 20px 0 0 12px;
}

.stone {
  padding: var(--stone-top) 16px 10px;
  border: 1px dashed var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.stone-built {
  border-style: solid;
  background: var(--ink);
  color: var(--paper);
}

.stone:nth-child(4n + 1) { --stone-top: 22px; }
.stone:nth-child(4n + 2) { --stone-top: 14px; }
.stone:nth-child(4n + 3) { --stone-top: 30px; }
.stone:nth-child(4n) { --stone-top: 18px; }

.layer-spaces,
.layer-id { font-size: 14px; }

.layer-spaces > span { flex: 1 1 140px; }

.layer-spaces > span,
.layer-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-spaces > span,
.layer-id,
.layer-core > span { padding: 16px 12px; }

.layer-detail {
  font-size: 11px;
  color: var(--muted);
}

.layer-core { font-size: 12px; }
.layer-core > span { flex: 1 1 110px; }
.layer-base { padding: 14px 12px; }

.layer-base > span {
  padding: 4px 8px;
  background: var(--paper);
  font-size: 12px;
  line-height: 2;
}

/* Реестр камней */

.registry-inner { gap: 32px; }

.filters {
  display: flex;
  flex-wrap: wrap;
}

.filter,
.hero-open {
  min-height: 44px;
  padding: 0 16px;
  border: var(--rule);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.filter { margin-left: -1px; }

.filter[aria-pressed="true"],
.hero-open,
.phase-status,
[data-e="1"] .registry-badge,
[data-e="1"] .registry-glyph > span {
  background: var(--ink);
  color: var(--paper);
  border-style: solid;
}

.registry-list,
.charter-grid,
.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.registry-list { border-top: var(--rule); }

.registry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding: 20px 0;
  border-bottom: var(--rule);
}

.registry-row[hidden] { display: none; }

.registry-code {
  flex: 0 0 64px;
  font-size: 12px;
  color: var(--muted);
}

.registry-glyph {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  width: 20px;
  height: 32px;
}

.registry-glyph > span {
  box-sizing: border-box;
  width: 20px;
  height: var(--glyph-height);
}

.registry-row:nth-child(4n + 1) { --glyph-height: 26px; }
.registry-row:nth-child(4n + 2) { --glyph-height: 18px; }
.registry-row:nth-child(4n + 3) { --glyph-height: 32px; }
.registry-row:nth-child(4n) { --glyph-height: 22px; }

.registry-name {
  flex: 1 1 240px;
  font-size: 28px;
  line-height: 1.1;
  text-transform: uppercase;
}

.registry-description {
  flex: 2 1 260px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--secondary);
}

.registry-link {
  flex: 1 1 150px;
  font-size: 12px;
  color: var(--secondary);
}

.registry-status {
  flex: 0 0 104px;
  min-width: max-content;
  display: flex;
  justify-content: flex-end;
}

.registry-badge {
  padding: 5px 9px;
  font-size: 11px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.registry-badge,
.registry-glyph > span { border: 1px dashed var(--ink); }

/* Устав обелиска */

.charter-inner {
  max-width: 1180px;
  padding-block: 96px;
  align-items: center;
}

.charter-intro {
  align-items: center;
  text-align: center;
}

.charter-date {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--panel-muted);
}

.charter-frame {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--panel-line);
}

.charter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--panel-line);
  border-left: 1px solid var(--panel-line);
}

.charter-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px 32px;
  border-right: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
  text-align: center;
}

.charter-number {
  font-size: 40px;
  line-height: 1;
}

.charter-rule {
  width: 24px;
  height: 1px;
  background: var(--panel-text);
}

.charter-text {
  font-size: 22px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.charter-english {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--panel-muted);
}

/* Журнал стройки */

.log-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-list {
  display: flex;
  flex-direction: column;
}

.log-list > li {
  display: flex;
  flex-wrap: wrap;
}

.log-elevation {
  flex: 0 0 96px;
  padding: 30px 16px 0 0;
  font-size: 12px;
  text-align: right;
}

.log-entry {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 24px 0 32px 32px;
  border-top: var(--rule);
  border-left: var(--rule);
}

.log-marker {
  position: absolute;
  top: 31px;
  left: -7px;
  width: 12px;
  height: 12px;
  background: var(--ink);
}

.log-date {
  flex: 0 0 120px;
  font-size: 12px;
  line-height: 1.6;
}

.log-copy {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-copy h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.log-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--secondary);
}

.log-upcoming { color: var(--muted); }
.log-upcoming p { color: inherit; }

.log-upcoming .log-entry {
  border-top: 0;
  border-left-style: dashed;
}

.log-upcoming .log-marker {
  background: var(--paper);
  border: 1px dashed var(--ink);
}

.log-ground .log-elevation {
  padding-top: 14px;
  font-weight: 500;
}

.log-ground .log-entry {
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  border-left: 0;
}

.ground-label {
  padding: 12px 0 12px 32px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.log-ground .hatch { height: 14px; }

/* Штамп */

.footer-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 48px;
  padding-bottom: 32px;
}

.footer-motto {
  flex: 999 1 520px;
  margin: 0;
  font-size: clamp(32px, 4vw, 64px);
  line-height: 1;
  text-transform: uppercase;
}

.stamp {
  flex: 1 1 380px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--panel-stamp-line);
  border-left: 1px solid var(--panel-stamp-line);
  font-size: 11px;
}

.stamp > div {
  padding: 10px;
  border-right: 1px solid var(--panel-stamp-line);
  border-bottom: 1px solid var(--panel-stamp-line);
}

.stamp dt { color: var(--panel-muted); }
.stamp dd { margin: 4px 0 0; }

.footer-legal {
  position: absolute;
  right: var(--gutter);
  bottom: 4px;
  display: flex;
  max-width: calc(100% - 2 * var(--gutter));
  gap: 16px;
  font-size: 11px;
  color: var(--panel-secondary);
}

.footer-legal a { padding-block: 5px; }

/* Служебные страницы */

.document > * { max-width: 65ch; }

.document .section-title {
  hyphens: auto;
  overflow-wrap: break-word;
}

.document h2 {
  margin: 32px 0 12px;
  font-size: 22px;
}

.document p,
.document address {
  margin: 16px 0;
  font-size: 15px;
  line-height: 1.55;
}

.document address { font-style: normal; }

.document-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 8px var(--gutter);
  max-width: var(--content-width);
  margin: 0 auto;
  font-size: 12px;
}

.document-nav a { padding-block: 8px; }

@media (max-width: 760px) {
  .charter-grid { grid-template-columns: minmax(0, 1fr); }
  .zones { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .zones span:nth-child(n + 5) { display: none; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }

  .nav-open { padding-inline-end: 0; }
  .nav-open-full { display: none; }
  .nav-open-short { display: inline; }
  .nav-links { flex-basis: 100%; }

  .section-inner { padding-block: 56px; }
  .hero-title { font-size: 38px; }

  .hero-stats { grid-template-columns: minmax(0, 1fr); }

  .hero-stats > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: var(--rule);
  }

  .hero-stats > div + div { border-left: 0; }

  .hero-stats dd {
    margin: 0;
    text-align: right;
  }

  .phase-description,
  .phase-tag:not(.phase-status) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .phase-title {
    font-size: 10px;
    letter-spacing: 0;
  }

  .phase-foundation .phase-title {
    flex-wrap: wrap;
    gap: 2px 6px;
    height: auto;
  }

  .phase-control { padding-bottom: 0; }

  .registry-glyph { display: none; }

  .charter-cell {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    padding: 20px 16px;
    text-align: left;
  }

  .charter-rule { display: none; }

  .charter-number {
    flex: 0 0 44px;
    font-size: 26px;
  }

  .charter-text {
    flex: 1 1 0;
    min-width: 0;
    font-size: 17px;
  }

  .charter-english {
    flex-basis: 100%;
    padding-left: 60px;
  }

  .log-elevation {
    flex-basis: 56px;
    padding-right: 8px;
  }

  .log-entry,
  .log-ground .log-entry {
    flex-basis: 200px;
    padding-left: 20px;
  }

  .footer-motto { font-size: 30px; }
  .stamp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Плоттер и отметки текущего этапа */

.plan-trace,
.hatch-drift,
.course-overlay,
.numeral-overlay,
.phase-underline,
.plan-replay { display: none; }

@keyframes reveal-ink {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hide-trace {
  to { opacity: 0; }
}

@keyframes plot-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes slide-svg-hatch {
  to { transform: translateX(7px); }
}

@keyframes slide-hatch {
  /* Один период штриховки в 7px под углом 45°. */
  to { transform: translateY(-9.899495px); }
}

@media (prefers-reduced-motion: no-preference) {
  html.has-motion { scroll-behavior: smooth; }

  .has-motion {
    --motion-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --phase-transition: 300ms var(--motion-ease-out);
  }

  .has-motion .hero-title,
  .has-motion .hero-description {
    animation: reveal-ink 460ms var(--motion-ease-out) both;
  }

  .has-motion .plan-drawing:not(.is-drawn) :is(.plan-ink, .phase),
  .has-motion .plan-drawing:not(.is-drawn, .is-drawing) .plan-leader {
    opacity: 0;
  }

  .has-motion .plan-drawing:not(.is-drawn, .is-drawing) .phase {
    pointer-events: none;
  }

  .has-motion .plan-replay {
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }

  .has-motion .is-drawing .plan-trace {
    display: inline;
    animation: hide-trace 300ms var(--motion-ease-out) 1040ms both;
  }

  .has-motion .is-drawing .plan-trace path,
  .has-motion .is-drawing .plan-leader line {
    stroke-dasharray: 1;
    animation: plot-line 1040ms var(--motion-ease-out) both;
  }

  .has-motion .is-drawing .plan-trace .plan-joint {
    animation-duration: 420ms;
    animation-delay: var(--joint-start, 0ms);
  }

  .plan-joint:nth-of-type(4) { --joint-start: 90ms; }
  .plan-joint:nth-of-type(5) { --joint-start: 180ms; }
  .plan-joint:nth-of-type(6) { --joint-start: 270ms; }
  .plan-joint:nth-of-type(7) { --joint-start: 360ms; }
  .plan-joint:nth-of-type(8) { --joint-start: 450ms; }

  .has-motion .is-drawing .plan-ink {
    animation: reveal-ink 300ms var(--motion-ease-out) 1040ms both;
  }

  .plan-leader:nth-child(5),
  [data-phase="II"] { --phase-stagger: 65ms; }

  .plan-leader:nth-child(4),
  [data-phase="III"] { --phase-stagger: 130ms; }

  .plan-leader:nth-child(3),
  [data-phase="IV"] { --phase-stagger: 195ms; }

  .plan-leader:nth-child(2),
  [data-phase="V"] { --phase-stagger: 260ms; }

  .plan-leader:nth-child(1),
  [data-phase="VI"] { --phase-stagger: 325ms; }

  .has-motion .is-drawing .plan-leader line {
    animation-duration: 480ms;
    animation-delay: calc(1050ms + var(--phase-stagger, 0ms));
  }

  .has-motion .is-drawing .plan-leader circle {
    animation: reveal-ink 300ms var(--motion-ease-out) calc(1050ms + var(--phase-stagger, 0ms)) both;
  }

  .has-motion .is-drawing .phase {
    animation: reveal-ink 450ms var(--motion-ease-out) calc(1420ms + var(--phase-stagger, 0ms)) both;
  }

  .has-motion .is-drawing .plan-hatch {
    animation: reveal-ink 480ms var(--motion-ease-out) 2200ms both;
  }

  .has-motion .is-drawn .hatch-rest { display: none; }

  .has-motion .is-drawn .hatch-drift {
    display: inline;
    fill: var(--accent);
    animation: slide-svg-hatch 6s linear infinite paused;
  }

  .has-motion .hatch-in-view .hatch-drift { animation-play-state: running; }

  .has-motion .layer-base {
    position: relative;
    isolation: isolate;
    overflow: clip;
  }

  .has-motion .layer-base::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 -10px;
    background: inherit;
    animation: slide-hatch 6s linear infinite paused;
  }

  .has-motion .layer-base.hatch-in-view::before { animation-play-state: running; }

  .motion-ready [data-course].is-selected:not([data-course="1"]) {
    fill: var(--paper);
    stroke-width: 1;
  }

  .motion-ready [data-num].is-selected:not([data-num="1"]) {
    fill: var(--ink);
    stroke: var(--paper);
  }

  .has-motion .course-overlay,
  .has-motion .numeral-overlay {
    display: inline;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--phase-transition);
  }

  .has-motion .course-overlay {
    fill: var(--ink);
    stroke: var(--ink);
    stroke-width: 2.5;
  }

  .has-motion .numeral-overlay {
    fill: var(--paper);
    stroke: var(--ink);
  }

  .has-motion .is-selected + :is(.course-overlay, .numeral-overlay) { opacity: 1; }

  .motion-ready .phase-name { position: relative; }
  .motion-ready [data-phase][aria-pressed="true"] .phase-name { text-decoration: none; }

  .has-motion .phase-underline {
    position: absolute;
    inset: 0;
    display: block;
    color: transparent;
    text-decoration: underline var(--ink);
    text-underline-offset: inherit;
    clip-path: inset(-2px 100% -7px 0);
    transition: clip-path var(--phase-transition);
  }

  .has-motion [data-phase][aria-pressed="true"] .phase-underline {
    clip-path: inset(-2px 0 -7px 0);
  }

  .has-motion .instant-phase :is(.course-overlay, .numeral-overlay, .phase-underline) {
    transition: none;
  }
}

/* Слои и камни, устав, ось журнала */

@keyframes lay-course {
  from { clip-path: inset(100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes seat-stone {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes carve-numeral {
  from { clip-path: inset(-4px 100% -4px 0); }
  to { clip-path: inset(-4px 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .has-motion .layer:nth-child(n + 2) { clip-path: inset(100% 0 0); }
  .has-motion .stone { opacity: 0; }

  .layer:nth-child(4) { --layer-delay: 105ms; }
  .layer:nth-child(3) { --layer-delay: 210ms; }
  .layer:nth-child(2) { --layer-delay: 315ms; }

  .has-motion .layers.is-revealed > .layer:nth-child(n + 2) {
    animation: lay-course 520ms var(--motion-ease-out) var(--layer-delay, 0ms) both;
  }

  .stone:nth-child(2) { --stone-delay: 60ms; }
  .stone:nth-child(3) { --stone-delay: 120ms; }
  .stone:nth-child(4) { --stone-delay: 180ms; }
  .stone:nth-child(5) { --stone-delay: 240ms; }
  .stone:nth-child(6) { --stone-delay: 300ms; }
  .stone:nth-child(7) { --stone-delay: 360ms; }
  .stone:nth-child(8) { --stone-delay: 420ms; }
  .stone:nth-child(9) { --stone-delay: 480ms; }
  .stone:nth-child(10) { --stone-delay: 540ms; }
  .stone:nth-child(11) { --stone-delay: 600ms; }
  .stone:nth-child(12) { --stone-delay: 660ms; }

  .has-motion .layers.is-revealed .stone {
    animation: seat-stone 440ms var(--motion-ease-out) calc(850ms + var(--stone-delay, 0ms)) both;
  }

  .has-motion .registry-row > span { clip-path: inset(0 100% 0 0); }
  .registry-row:nth-child(4n + 2) { --row-delay: 60ms; }
  .registry-row:nth-child(4n + 3) { --row-delay: 120ms; }
  .registry-row:nth-child(4n) { --row-delay: 180ms; }

  .has-motion :is(.registry-list.is-revealed > .registry-row, .registry-row.is-revealed) > span {
    animation: carve-numeral 500ms var(--motion-ease-out) var(--row-delay, 0ms) both;
  }

  .has-motion .charter-number { clip-path: inset(0 100% 0 0); }
  .charter-cell:nth-child(3n + 2) { --carve-delay: 70ms; }
  .charter-cell:nth-child(3n) { --carve-delay: 140ms; }

  .has-motion :is(.charter-grid.is-revealed > .charter-cell, .charter-cell.is-revealed) .charter-number {
    animation: carve-numeral 450ms var(--motion-ease-out) var(--carve-delay, 0ms) both;
  }

  .has-motion .log-list { --axis-step: 340ms; }
  .has-motion .log-list:not(.axis-finished) .log-entry { border-left-color: transparent; }
  .has-motion .log-list:not(.axis-finished) .log-marker { opacity: 0; }

  .log-list > li:nth-last-child(3) { --axis-delay: var(--axis-step); }
  .log-list > li:nth-last-child(4) { --axis-delay: calc(2 * var(--axis-step)); }
  .log-list > li:nth-last-child(5) { --axis-delay: calc(3 * var(--axis-step)); }

  .has-motion .log-list.is-revealed:not(.axis-finished) > li:not(.log-ground) .log-entry::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: -1px;
    border-left: var(--rule);
    animation: lay-course var(--axis-step) var(--motion-ease-out) var(--axis-delay, 0ms) both;
  }

  .has-motion .log-list.is-revealed:not(.axis-finished) .log-upcoming .log-entry::before {
    border-left-style: dashed;
  }

  .has-motion .log-list.is-revealed:not(.axis-finished) .log-marker {
    animation: reveal-ink 300ms var(--motion-ease-out) calc(var(--axis-delay, 0ms) + 190ms) both;
  }

  /* Реестр и следующие за ним блоки приходят в новое положение вместе. */
  .has-motion .registry-list { position: relative; }

  .has-motion .registry-leaving {
    position: absolute;
    inset-inline: 0;
    z-index: 1;
    pointer-events: none;
  }

  :where(.has-motion.registry-transition) .registry-row {
    clip-path: inset(0);
    transition:
      transform 350ms var(--motion-ease-out),
      clip-path 350ms var(--motion-ease-out),
      opacity 350ms var(--motion-ease-out);
  }

  .has-motion :is(#registry-caption, #charter, #log, .sheet > footer, .sheet > .zones:last-child) {
    transform: var(--registry-position, none);
  }

  .has-motion #registry-caption { opacity: var(--count-opacity, 1); }

  .has-motion.registry-transition :is(#registry-caption, #charter, #log, .sheet > footer, .sheet > .zones:last-child) {
    transition: transform 350ms var(--motion-ease-out), opacity 350ms var(--motion-ease-out);
  }

  .has-motion .link-label { position: relative; }

  .has-motion .link-label::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -3px;
    border-bottom: 1px solid currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms var(--motion-ease-out);
  }

  .has-motion a:focus-visible { text-decoration: none; }
  .has-motion a:focus-visible .link-label::after { transform: scaleX(1); }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .has-motion .registry-glyph > span { transition: transform 300ms var(--motion-ease-out); }
  .has-motion .registry-row:hover .registry-glyph > span { transform: translateY(-3px); }

  .has-motion a:hover { text-decoration: none; }
  .has-motion a:hover .link-label::after { transform: scaleX(1); }

  .has-motion .zones span { position: relative; }

  .has-motion .zones span::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--motion-ease-out);
  }

  .has-motion .zones span.is-pointed::before { opacity: 0.1; }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .has-motion #registry .registry-row.is-revealed > span,
  .has-motion #charter .charter-cell.is-revealed .charter-number {
    animation-duration: 240ms;
    animation-delay: 0ms;
  }

  .has-motion #log .log-marker {
    opacity: 0;
    animation: none;
  }

  .has-motion #log .log-entry.is-revealed .log-marker {
    animation: reveal-ink 240ms var(--motion-ease-out) both;
  }
}
