html {
  overscroll-behavior: none;
}

body {
  --footer-height: calc((var(--block-space)) + 3.6em + var(--block-space));
  --navbar-height: 4.125em;
  --sidebar-width: 0vw;

  display: grid;
  grid-template-areas:
    "nav sidebar"
    "main sidebar";
  grid-template-columns: 1fr var(--sidebar-width);
  grid-template-rows: min-content 1fr;
  max-block-size: 100dvh;

  &.sidebar {
    @media (min-width: 120ch) {
      --sidebar-width: calc(26vw + var(--sidebar-tools-width));
    }
  }
}

#app-logo {
  display: none;

  @media (min-width: 120ch) {
    block-size: var(--footer-height);
    display: grid;
    filter: saturate(0);
    inline-size: 5vw;
    inset: auto auto 0 0;
    opacity: 0.5;
    padding-inline: 1vw;
    place-items: center;
    position: absolute;
    transition: opacity 500ms ease-in-out, filter 500ms ease-in-out;

    & img {
      block-size: auto;
      inline-size: 100%;
      max-inline-size: 2.75em;
    }

    &:hover {
      filter: none;
      opacity: 1;
    }
  }
}

#nav {
  grid-area: nav;
}

#main-content {
  align-content: start;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  grid-area: main;
  overflow: auto;
  position: relative;

  .sidebar & {
    justify-content: end;

    @media (min-width: 120ch) {
      border-inline: 1px solid var(--color-border-darker);
      margin-inline: 5vw 0;
    }
  }
}

#sidebar {
  grid-area: sidebar;
  position: relative;
  transition: transform 300ms ease;

  .sidebar & {
    -webkit-backdrop-filter: blur(66px);
    backdrop-filter: blur(66px);
    background-color: oklch(var(--lch-white) / 0.66);
    block-size: 100dvh;
    max-block-size: 100dvh;
    z-index: 3;

    @media (max-width: 120ch) {
      inset: 0;
      position: fixed;
      transform: translate(100%);
    }
  }

  &.open {
    @media (max-width: 120ch) {
      transform: translate(0);
    }
  }
}

#footer {
  grid-area: footer;
}
