@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(calc(100dvh - var(--margin-top)));
  }
  to {
    transform: translateY(0);
  }
}

@keyframes staggerIn {
  from {
    transform: translateY(150px);
  }
  to {
    transform: translateY(0);
  }
}

html.intro-animation .menu-button .sticker {
  animation: 500ms ease-out 1000ms both fadeIn;
}

/* html.intro-animation .menu-button-layer--logo {
  animation: 500ms ease-out 3000ms forwards fadeOut, 500ms ease-out 5000ms forwards fadeIn;
}
html.intro-animation .menu-button-layer--menu {
  animation: 500ms ease-out 3000ms forwards fadeIn, 500ms ease-out 5000ms forwards fadeOut;
} */

html.intro-animation-show-menu .menu-button-layer--logo {
  opacity: 0;
}
html.intro-animation-show-menu .menu-button-layer--menu {
  opacity: 1;
}

html.intro-animation main {
  animation: 500ms ease-out 2000ms both slideIn;
}

@media (min-width: 80em) {
  html.intro-animation .cards-transition > :nth-child(2n + 2) {
    animation: 500ms ease-out 2000ms both staggerIn;
  }
}

.container {
  position: relative;
}

.header {
  pointer-events: none;
  position: absolute;
  inset: 0;
  padding-block-end: 70px;
}

header-container dialog[open] {
  opacity: 1;
}
header-container {
  display: contents;
}
header-container dialog {
  pointer-events: all;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  /* Work around a Safari rendering issue by rounding to even dimensions. */
  width: round(calc(100% - 20px), 2px);
  height: round(calc(100% - 20px), 2px);
  max-width: 400px;
  max-height: 525px;
  margin: auto;
  opacity: 0;
  background-color: transparent;
  transition:
    opacity 500ms ease-out,
    overlay 500ms ease-out allow-discrete,
    display 500ms ease-out allow-discrete;
}
@starting-style {
  header-container dialog[open] {
    opacity: 0;
  }
}
header-container dialog::backdrop {
  background-color: rgb(0 0 0 / 0%);
  transition:
    display 500ms allow-discrete,
    overlay 500ms allow-discrete,
    background-color 500ms;
}
header-container dialog[open]::backdrop {
  background-color: rgb(0 0 0 / 0%);
}
@starting-style {
  header-container dialog[open]::backdrop {
    background-color: rgb(0 0 0 / 0%);
  }
}

.header action-button:has(> .menu-button) {
  display: contents;
}
.menu-button {
  pointer-events: all;
  z-index: 100;
  position: sticky;
  top: calc(50dvh - 60px);
  margin-inline: auto;
  display: block;
  width: 260px;
  max-width: calc(100% - 2 * var(--grid-margin));
  aspect-ratio: 260/120;
}
.menu-button-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 500ms ease-out;
}
.menu-button-layer--menu {
  opacity: 0;
}
@media (hover: hover) {
  .menu-button:hover .menu-button-layer--logo {
    opacity: 0 !important;
  }
  .menu-button:hover .menu-button-layer--menu {
    opacity: 1 !important;
  }
}
.menu-button-text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  padding-inline: 20px;
}
.menu-button-text > * {
  height: 1.875rem;
  display: flex;
  padding: 5px;
  border-block-start: var(--border);
}
.menu-button-text > :last-child {
  border-block-end: var(--border);
}

.menu {
  padding: 30px 20px;
  height: 100%;
  display: grid;
  grid-template-rows: max-content 1fr max-content;
}
.menu-header {
  border-top: var(--border);
  padding: 5px 3px 0;
  display: flex;
  justify-content: space-between;
}
.menu-nav {
  display: contents;
}
.menu-wrapper {
  position: relative;
  align-self: center;
}
.menu-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
}
.menu-overlay > * {
  flex: 1;
  min-height: 0;
}
.menu-overlay action-button button {
  width: 100%;
  height: 100%;
}
.menu-items {
  text-align: center;
}
.menu-items :is(a, button) {
  transition: color 500ms ease-out;
}
.menu-wrapper:has(a.active, :is(a, button):hover),
.menu-wrapper:has(.menu-items a.active, .menu-overlay :is(a, button):hover) .menu-items :is(a, button) {
  color: var(--grey-02);
}
.menu-items :is(a.active, :is(a, button):hover),
.menu-wrapper:has(.menu-overlay > :nth-child(1):hover) .menu-items > :nth-child(1) :is(a, button),
.menu-wrapper:has(.menu-overlay > :nth-child(2):hover) .menu-items > :nth-child(2) :is(a, button),
.menu-wrapper:has(.menu-overlay > :nth-child(3):hover) .menu-items > :nth-child(3) :is(a, button),
.menu-wrapper:has(.menu-overlay > :nth-child(4):hover) .menu-items > :nth-child(4) :is(a, button) {
  color: var(--dark-01) !important;
}

.about {
  height: 100%;
  display: grid;
  grid-template-rows: max-content 1fr max-content;
}
.about-header {
  margin-block-start: 30px;
  margin-inline: 20px;
  border-top: var(--border);
  padding: 5px 3px;
  display: flex;
  justify-content: space-between;
}
.about-body {
  display: grid;
  grid-template-rows: 1px 1fr 1px;
  min-height: 0;
  padding-block-end: 30px;
}
.about-body::before, .about-body::after {
  content: "";
  display: block;
  border-top: var(--border);
  margin-inline: 20px;
}
.about-scroll {
  overscroll-behavior: contain;
  overflow: auto;
  padding-inline: 20px;
  text-align: center;
}
.about-scroll > :first-child {
  margin-block-start: 34px;
}
.about-scroll > :last-child {
  margin-block-end: 34px;
}
.about-scroll .illustration {
  display: flex;
  justify-content: center;
  margin-block: 30px 40px;
  filter: var(--blur);
  transform: translateZ(0);
}
.about-scroll .illustration:last-child {
  margin-block: 110px 34px;
}
.about-scroll .signature {
  width: 150px;
  height: 120px;
  object-fit: contain;
  margin-block-start: -32px;
  margin-inline: auto;
}
