
.page {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.page__main {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: var(--gutter);
}

.page__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--content-max);
  min-height: 100vh;
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
}

/* ------------------------------ Maze strip ------------------------------ */

.maze {
  position: sticky;
  top: 0;
  flex: 0 0 var(--maze-w);
  width: var(--maze-w);
  height: 100vh;
  background-repeat: repeat-y;
  background-size: var(--maze-bg-w) auto;
  background-position: 0 0;
  animation: maze-drift 80s linear infinite;
  will-change: background-position;
}

:root[data-theme="light"] .maze {
  background-image: url("../assets/maze-light.svg");
}

:root[data-theme="dark"] .maze {
  background-image: url("../assets/maze-dark.svg");
}

/* ------------------------------- Header -------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(26px, 4.4vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand__word {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand__mark {
  height: 0.95em;
  width: auto;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  fill: currentColor;
  stroke: none;
}

.brand__mark--light {
  aspect-ratio: 36 / 26;
}

.brand__mark--dark {
  aspect-ratio: 1;
  height: 0.8em;
  opacity: 0.95;
}

:root[data-theme="light"] .brand__mark--dark,
:root[data-theme="dark"] .brand__mark--light {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 18px;
  color: var(--ink-soft);
  border-radius: 50%;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.4s var(--ease-back);
}

.icon-btn:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: rotate(18deg);
}

:root[data-theme="light"] .theme-toggle .icon--sun,
:root[data-theme="dark"] .theme-toggle .icon--moon {
  display: none;
}

.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.lang__btn .icon {
  font-size: 22px;
  stroke-width: 1.4;
  color: var(--ink);
}

.lang__btn:hover {
  color: var(--ink);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: 170px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.35);
  animation: pop-in 0.22s var(--ease-out) both;
}

.lang__menu[hidden] {
  display: none;
}

.lang__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.92rem;
  text-align: start;
  color: var(--ink);
}

.lang__item:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.lang__item.is-current::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
}

/* ------------------------------- Footer -------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(24px, 4vw, 36px);
  padding: 18px 0 clamp(22px, 3vw, 30px);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.site-footer__domain {
  transition: color 0.2s ease;
}

.site-footer__domain:hover {
  color: var(--ink);
}

.site-footer__rule {
  display: none;
  flex: 1;
  height: 1px;
  background: var(--line);
}

.site-footer__tagline {
  margin-inline-start: auto;
  font-size: 0.72rem;
}

:root[data-theme="dark"] .site-footer {
  border-top-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .site-footer__rule {
  display: block;
}

:root[data-theme="dark"] .site-footer__tagline {
  margin-inline-start: 0;
  color: var(--ink-soft);
}

/* Scroll reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
