html,
body {
  min-height: 100%;
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

body {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  color: #333;
  /* background-color: #282826;
  background-image: url(../images/nuno.jpg);
  background-size: cover;
  background-position: center center;
  backdrop-filter: blur(10px) brightness(10%); */
  font-family: Montserrat, sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

.gap {
  flex-grow: 1;
}

* {
  box-sizing: border-box;
}

body:not(.home).scrolled .name-wrapper {
  box-shadow: 0 0 4px #0004;
}

body.home.scrolled .footer-xxx {
  box-shadow: 0 0 1px #0004;
}

.name-wrapper {
  position: sticky;
  top: 0;
  left: 0;
  height: 5rem;
  width: 100%;
  padding: 1rem 1rem 1rem 1.5rem;
  flex-shrink: 0;
  background-color: #fff;
  z-index: 2;
  display: flex;
  justify-content: center;
  transition: box-shadow ease-in .3s;

  .inner {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.cos-toggle {
  background: transparent;
  padding: 0;
  border: none;
  cursor: pointer;

  span {
    font-size: 2.5rem;
    color: #333;
  }

  transition: background ease-in .1s;

  &:hover {
    background: #ccc;
  }

  &.active {
    background-color: #aaa;
  }
}

.main-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;

  height: 0;
  opacity: 0;
  transition: height ease-in .3s, opacity ease-in .3s;

  &.open,
  &:focus-within {
    height: 9.5rem;
    opacity: 1;
  }

  a {
    display: block;
    text-align: center;
    padding: .25rem 0;
    font-size: 1rem;
    line-height: 1.2rem;
    text-decoration: none;
    text-transform: uppercase;
    color: #333;

    &:hover {
      color: #000;
      text-decoration: underline;
    }

    &.disabled {
      color: #aaa;
      pointer-events: none;
      cursor: default;
    }

    &.active {
      text-decoration: none !important;
      color: #000;
    }
  }
}

.name {
  max-height: 3rem;
  max-width: calc(50vw);
  opacity: .75;
  /* position: absolute;
  top: 2rem;
  left: 2rem;*/
}

.body {
  padding: 0 1rem 1rem 1rem;
  font-size: 1rem;
  line-height: 1.25;
  text-align: justify;
  flex-shrink: 0;
  min-height: calc(100svh - 10rem);
  width: 100%;

  >h1 {
    text-align: right;
    font-size: 1.25rem;
    font-weight: 200;
    margin: 1rem 0 2rem;
    color: #222;
    text-transform: uppercase;
  }

  >h2 {
    font-size: 1rem;
    font-weight: 400;
    margin: 3rem 0 2rem;
    color: #222;
    text-transform: uppercase;
  }

  >ul {
    padding-inline-start: 1rem;
    > li {
      margin-bottom: 1rem;
      > strong {
        font-weight: 500;
      }
    }
    &.none {
      list-style: none;
      padding-inline-start: 0;
    }
  }

  >p {
    margin-bottom: .5rem;
  }
}

.not-found {
  font-size: 2rem;
  color: white;
}

.carousel {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;

  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  anchor-name: --carousel;
  scroll-behavior: smooth;
  scrollbar-width: none;

  >.carousel__slide {
    scroll-snap-align: center;
    scroll-snap-stop: always;

    width: 100vw;
    height: calc(100svh - 16rem);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.placeholder {
  max-width: 100%;
  max-height: 100%;
  padding: 1rem;
  /*box-shadow: 0 0 8px #0008;
  border: 1px solid #fff3;
  border-radius: 4px;*/
}

.carousel--scroll-buttons {
  &::scroll-button(*) {
    position: fixed;
    position-anchor: --carousel;
    position-visibility: always;
    font-family: "Material Symbols Sharp";
  }

  &::scroll-button(right) {
    position-area: inline-end center;
    margin-left: -3rem;
    content: 'arrow_forward' / 'Next';
  }

  &::scroll-button(left) {
    position-area: inline-start center;
    content: 'arrow_back' / 'Previous';
    margin-right: -3rem;
  }

  &::scroll-button(*) {
    padding: .5rem;
    border-radius: 50%;
    border: none;
    background: #3338;
    color: #fff;
    transition: all ease-in .3s;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  &::scroll-button(*):disabled {
    opacity: .2;
  }
}

.carousel--scroll-markers {
  scroll-marker-group: after;

  &::scroll-marker-group {
    position: fixed;
    position-anchor: --carousel;
    position-area: block-end;
    position-visibility: always;
    z-index: 1;
    margin: 12px;

    display: grid;
    grid-auto-columns: 16px;
    grid-auto-flow: column;
    gap: 8px;
  }

  >.carousel__slide {
    &::scroll-marker {
      content: '' / attr(data-label);

      aspect-ratio: 1;
      border-radius: 0;
      width: 12px;
      height: 12px;
      border: 1px solid #999;
      transition: background-color ease-in .3s;
    }

    &::scroll-marker:target-current {
      background: #666;
    }
  }
}

.go-home {
  font-size: 12rem;
  font-weight: 300;
  color: #007caa;
  text-decoration: none;
  margin-top: 4rem
}

.footer {
  z-index: 0;
  box-sizing: border-box;
  padding: 1rem;
  height: 5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #fff;
  flex-shrink: 0;
  transition: box-shadow ease-in .1s;
}

body.home {
  .footer {
    position: sticky;
    bottom: 0;
  }
}

.copr {
  align-self: center;
  font-size: .75rem;
}

a.insta {
  align-self: end;
  color: #555;
  opacity: .75;
  text-decoration: none;
  font-size: 2.5rem;
  display: block;
  transition: color ease-in .1s;
  text-align: right;

  >img {
    width: 1.75rem;
    margin-bottom: .25rem;
  }

  &:hover {
    color: #ffffff;
  }
}

.at {
  display: block;
  font-size: .8rem;
  font-weight: 400;
}

@media (min-aspect-ratio: 3/4) {
  body {
    --width: calc(min(100vw, 48rem));
  }

  .name-wrapper {
    padding: 1.25rem 0;
    height: 6rem;

    .inner {
      width: var(--width);
      flex-grow: 0;
    }
  }

  .name {
    transform: none;
  }

  .cos-toggle {
    padding: 0 .25rem;
    margin-right: -.25rem;
    display: none;
  }

  .body {
    min-height: calc(100svh - 11rem);
    width: var(--width);
    padding: 0;

    >h1 {
      margin: 2rem 0;
      display: none;
    }
  }

  .footer {
    padding: 1rem 0;

    .inner {
      align-self: center;
      width: var(--width);
    }
  }

  .main-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: var(--width);
    height: 5rem;
    opacity: 1;

    a {
      border-bottom: 2px solid transparent;

      &.active {
        border-bottom: 2px solid black;
      }
    }

    &.open,
    &:focus-within {
      height: 5rem;
    }
  }

  .carousel {
    display: flex;
    flex-direction: column;
    width: var(--width);
    height: calc(min(var(--width), 100vh - 16rem));

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;

    /* mask-image: linear-gradient(0,
        transparent,
        #000 .5rem,
        #000 calc(100% - .5rem),
        transparent 100%); */

    >.carousel__slide {
      width: var(--width);
      height: calc(min(var(--width), 100vh - 16rem) - 2rem);
      margin: 1rem 0;
    }
  }

  #nanogallery2 {
    padding-top: 1rem;
  }
}