body > .frame {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--frame);
}

main {
  flex: 1;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bar);
  backdrop-filter: blur(6px);
}

.bar img {
  display: block;
  height: 22px;
  width: auto;
  filter: var(--logo-filter);
}

/* Recolour the logo to --hot on hover by using it as a mask */
.logo {
  position: relative;
  display: block;
}

.logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hot);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.logo img {
  transition: opacity 0.2s ease;
}

/* Without mask support the overlay would be a solid box, so keep the white logo */
@supports (-webkit-mask: none) {
  .logo:hover::after,
  .logo:focus-visible::after {
    opacity: 1;
  }

  .logo:hover img,
  .logo:focus-visible img {
    opacity: 0;
  }
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bar nav a {
  padding: 6px 10px;
  border: 1px solid transparent;
  text-transform: uppercase;
  font-size: 12px;
}

.bar nav a:hover,
.bar nav a[aria-current='page'] {
  border-color: var(--hot);
  color: var(--hot);
}

.bar-end {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang {
  display: flex;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.lang a,
.theme button {
  padding: 4px 6px;
  color: var(--dim);
  border: 1px solid transparent;
}

.lang a + a,
.theme button + button {
  border-left-color: var(--line);
}

.lang a:hover,
.theme button:hover {
  color: var(--hot);
}

.lang a[aria-current='true'],
.theme button[aria-pressed='true'] {
  color: var(--text);
}

/* Day/night switch, styled like the language switcher (shown by application.js) */
.theme {
  display: flex;
}

.theme[hidden] {
  display: none;
}

.theme button {
  display: flex;
  background: none;
  cursor: pointer;
}

/* Thin, round lines like the planet icon */
.theme svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status b {
  color: var(--ok);
  font-weight: 400;
}

.blink {
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
}

footer a:hover,
footer button:hover {
  color: var(--hot);
}

footer button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  padding: 4px;
  background: none;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded='true'] {
  color: var(--hot);
}

.menu-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.menu-toggle .close,
.menu-toggle[aria-expanded='true'] .open {
  display: none;
}

.menu-toggle[aria-expanded='true'] .close {
  display: inline;
}

@media (max-width: 720px) {
  .bar {
    position: static;
  }

  .status {
    display: none;
  }

  /* Language switcher next to the logo, navigation on its own row below */
  .bar nav:not(.lang) {
    order: 2;
    flex-basis: 100%;
  }

  /* With JavaScript: one row (logo, switches, burger) that stays on top,
     the navigation opens below it as data rows */
  .bar.has-menu {
    position: sticky;
  }

  .bar.has-menu .menu-toggle:not([hidden]) {
    display: block;
  }

  .bar.has-menu nav:not(.lang) {
    display: none;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .bar.has-menu.menu-open nav:not(.lang) {
    display: flex;
  }

  .bar.has-menu nav:not(.lang) a {
    padding: 12px 0;
    border: 0;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
  }

  .bar.has-menu nav:not(.lang) a:last-child {
    border-bottom: 0;
  }
}
