@font-face {
  font-family: "Footer Microphone Check";
  src: url("../assets/fonts/Microphone Check.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.portfolio-footer {
  --footer-accent: #ea0044;

  width: 100%;
  min-width: 0;

  position: relative;
  isolation: isolate;

  background: #111112;
  color: #f7f7f7;

  font-family: "Roboto", Arial, Helvetica, sans-serif;

  scroll-margin-top: 100px;
}

.portfolio-footer,
.portfolio-footer *,
.portfolio-footer *::before,
.portfolio-footer *::after {
  box-sizing: border-box;
}

/* Main container */

.portfolio-footer .portfolio-footer__inner {
  padding-top: 44px;
  padding-bottom: 44px;

  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top section */

.portfolio-footer .portfolio-footer__top {
  padding-bottom: 24px;
  border-bottom: 1px solid #828282;

  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* Heading */

.portfolio-footer .portfolio-footer__heading {
  margin: 0;

  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-size: 60px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.portfolio-footer .portfolio-footer__first-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  column-gap: 20px;
}

.portfolio-footer .portfolio-footer__second-line {
  display: block;
  overflow-wrap: anywhere;
}

/* Text cycle */

.portfolio-footer .portfolio-footer__cycle {
  display: inline-grid;

  padding-inline: 0.1em;
  margin-inline: -0.1em;

  overflow: hidden;

  font-family: "Footer Microphone Check", cursive;
  font-size: 62px;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;

  line-height: 1.45;
  letter-spacing: 0.03em;

  color: var(--footer-accent);
}

/*
  All three words occupy the same grid cell.
  The longest word reserves the width throughout the cycle.
*/

.portfolio-footer .portfolio-footer__cycle-word {
  grid-area: 1 / 1;

  white-space: nowrap;

  opacity: 0;
  filter: blur(5px);
  transform: translateY(100%);

  transition:
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.8s ease,
    filter 0.8s ease;
}

.portfolio-footer .portfolio-footer__cycle-word.is-active {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.portfolio-footer .portfolio-footer__cycle-word.is-exiting {
  transform: translateY(-100%);
}

.portfolio-footer .portfolio-footer__cycle-word.is-resetting {
  transition: none;
}

/* Contact grid */

.portfolio-footer .portfolio-footer__contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.portfolio-footer .portfolio-footer__group {
  min-width: 0;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.portfolio-footer .portfolio-footer__group--social {
  gap: 16px;
}

.portfolio-footer .portfolio-footer__label {
  margin: 0;

  font-size: 16px;
  font-weight: 400;
  line-height: 1.12;

  color: #828282;
}

/* Email and links */

.portfolio-footer .portfolio-footer__link,
.portfolio-footer .portfolio-footer__email {
  max-width: 100%;

  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;

  color: #f7f7f7;
  text-decoration: none;

  overflow-wrap: anywhere;

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
}

.portfolio-footer .portfolio-footer__email {
  user-select: text;
  -webkit-user-select: text;
}

.portfolio-footer .portfolio-footer__link:hover,
.portfolio-footer .portfolio-footer__email:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Social buttons */

.portfolio-footer .portfolio-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portfolio-footer .portfolio-footer__social {
  width: 30px;
  height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 24px;

  background: var(--footer-accent);
  color: #fafafa;

  text-decoration: none;

  transition: transform 0.2s ease;

  -webkit-tap-highlight-color: transparent;
}

.portfolio-footer .portfolio-footer__social svg {
  display: block;

  width: 14px;
  height: 14px;
}

.portfolio-footer .portfolio-footer__social:hover {
  transform: translateY(-6px);
}

.portfolio-footer a:focus-visible,
.portfolio-footer [role="button"]:focus-visible {
  outline: 2px solid var(--footer-accent);
  outline-offset: 5px;
}

/* Menu and copyright */

.portfolio-footer .portfolio-footer__bottom {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;

  align-items: start;
}

.portfolio-footer .portfolio-footer__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.portfolio-footer .portfolio-footer__menu-links {
  display: flex;
  flex-wrap: wrap;

  gap: 10px 24px;
}

.portfolio-footer .portfolio-footer__copyright {
  margin: 0;

  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;

  color: #b8b8b8;
}

/* Large name */

.portfolio-footer .portfolio-footer__brand {
  width: 100%;
  min-width: 0;

  margin-top: 24px;
}

.portfolio-footer .portfolio-footer__brand-text {
  display: inline-block;

  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-size: clamp(20px, 9vw, 120px);
  font-weight: 700;

  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: nowrap;

  color: var(--footer-accent);
}

/* Copy notification */

.portfolio-footer__toast {
  position: fixed;
  z-index: 20;

  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));

  width: max-content;
  max-width: calc(100% - 44px);

  padding: 12px 20px;
  border-radius: 14px;

  background: var(--footer-accent, #ea0044);
  color: #fff;

  box-shadow: 0 8px 30px rgb(0 0 0 / 25%);

  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;

  opacity: 0;
  transform: translate(-50%, 10px);

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.portfolio-footer__toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile and tablet sizing at your main breakpoint */

@media (max-width: 768px) {
  .portfolio-footer {
    scroll-margin-top: 96px;
  }

  .portfolio-footer .portfolio-footer__inner {
    padding-top: 32px;
    padding-bottom: 32px;

    gap: 32px;
  }

  .portfolio-footer .portfolio-footer__heading {
    font-size: clamp(32px, 8.5vw, 44px);
  }

  .portfolio-footer .portfolio-footer__first-line {
    column-gap: 16px;
  }

  .portfolio-footer .portfolio-footer__cycle {
    font-size: clamp(38px, 10vw, 56px);
  }

  .portfolio-footer .portfolio-footer__contacts {
    grid-template-columns: minmax(0, 1fr);
  }

  .portfolio-footer .portfolio-footer__label {
    font-size: 13px;
  }

  .portfolio-footer .portfolio-footer__link,
  .portfolio-footer .portfolio-footer__email {
    font-size: 16px;
  }

  .portfolio-footer .portfolio-footer__bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .portfolio-footer .portfolio-footer__brand {
    margin-top: 0;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .portfolio-footer__toast,
  .portfolio-footer *,
  .portfolio-footer *::before,
  .portfolio-footer *::after {
    transition: none !important;
  }
}

.portfolio-footer .portfolio-footer__cycle {
  transform: translateY(0.08em);
}
