/* Modern enhancements layered over the original Mish Fraser Writes theme. */
:root {
  --mish-red: #e31b23;
  --mish-ink: #171717;
  --mish-ease: cubic-bezier(.22, 1, .36, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  overflow-x: hidden;
}

/* Keep linked section headings close to the fixed navigation. */
#about,
#plays,
#links,
#contact {
  padding-top: 72px;
}

.hero-text {
  animation: hero-text-in .8s var(--mish-ease) 2s both;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .9), 0 12px 30px rgba(0, 0, 0, .65);
}

.hero-logo {
  animation: hero-logo-drop 1s var(--mish-ease) 4s both;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .55)) drop-shadow(0 22px 30px rgba(0, 0, 0, .38));
  height: auto;
  max-width: min(300px, 72vw);
}

@keyframes hero-text-in {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hero-logo-drop {
  from {
    opacity: 0;
    transform: translate3d(0, -110px, 0) scale(.94);
  }
  65% {
    opacity: 1;
    transform: translate3d(0, 8px, 0) scale(1.01);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

header.header-dark {
  transition: background-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}

header.header-dark.is-scrolled {
  background-color: rgba(12, 12, 12, .9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Bootstrap 5 no longer gives columns a max-width, so the legacy theme's
   width: 100% navbar-header rule must be reset at desktop sizes. */
@media (min-width: 992px) {
  header .navbar-header {
    flex: 0 0 auto;
    width: 25%;
  }

  header .navbar-wrapper {
    align-items: center;
    flex: 0 0 auto;
    width: 75%;
  }
}

.nav-link {
  position: relative;
}

.nav-link::after {
  background: var(--mish-red);
  bottom: .35rem;
  content: "";
  height: 2px;
  left: .5rem;
  position: absolute;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--mish-ease);
  width: calc(100% - 1rem);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity .75s var(--mish-ease), transform .75s var(--mish-ease);
  will-change: opacity, transform;
}

.reveal.reveal-left {
  transform: translate3d(-42px, 0, 0);
}

.reveal.reveal-right {
  transform: translate3d(42px, 0, 0);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.gallery-grid .item img {
  transition: transform .6s var(--mish-ease), filter .6s ease;
}

.gallery-grid .item:hover img {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.025);
}

.scroll-to-top {
  align-items: center;
  background: var(--mish-red);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  bottom: 22px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
  color: #fff;
  display: flex;
  height: 48px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  right: 22px;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s var(--mish-ease), background-color .25s ease;
  visibility: visible;
  width: 48px;
}

.scroll-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
  background: var(--mish-ink);
  color: #fff;
  transform: translateY(-3px);
}

.scroll-to-top:focus-visible,
.nav-link:focus-visible {
  outline: 3px solid rgba(227, 27, 35, .45);
  outline-offset: 3px;
}

@media (max-width: 991.98px) {
  #navbar-header {
    background: rgba(12, 12, 12, .96);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
    padding: .75rem 1rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-logo,
  .hero-text { animation: none; opacity: 1; transform: none; }
}
