#mmfs,
#mmfs * {
  box-sizing: border-box;
}

#mmfs {
  --gutter: 2rem;
  --mmfs-intro-bottom: clamp(1.25rem, 5vh, 3rem);
  --mmfs-bg-start: #050505;
  --mmfs-bg-mid: #111111;
  --mmfs-bg-end: #1D0D2F;
  --mmfs-bg-start-dark: #050505;
  --mmfs-bg-mid-dark: #111111;
  --mmfs-bg-end-dark: #1D0D2F;
  margin: 0;
  background: linear-gradient(180deg, var(--mmfs-bg-start) 0%, var(--mmfs-bg-mid) 48%, var(--mmfs-bg-end) 100%);
  color: #fff;
}

#mmfs .mmfs__wrap {
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--mmfs-bg-end) 38%, transparent) 0%, transparent 42%),
    linear-gradient(180deg, var(--mmfs-bg-start) 0%, var(--mmfs-bg-mid) 48%, var(--mmfs-bg-end) 100%);
  overflow: clip;
}

html[data-theme="dark"] #mmfs {
  background: linear-gradient(180deg, var(--mmfs-bg-start-dark) 0%, var(--mmfs-bg-mid-dark) 48%, var(--mmfs-bg-end-dark) 100%);
}

html[data-theme="dark"] #mmfs .mmfs__wrap {
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--mmfs-bg-end-dark) 38%, transparent) 0%, transparent 42%),
    linear-gradient(180deg, var(--mmfs-bg-start-dark) 0%, var(--mmfs-bg-mid-dark) 48%, var(--mmfs-bg-end-dark) 100%);
}

#mmfs .mmfs__scrollstage--gallery {
  min-height: 240vh;
}

#mmfs .content {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100vw;
  display: flex;
  place-items: center;
  align-content: center;
  position: sticky;
  top: 0;
  overflow: hidden;
}

#mmfs .grid {
  --offset: 0;
  --container-width: 1600px;
  --gap: clamp(8px, 3.8vw, 42px);
  width: var(--container-width);
  max-width: calc(100% - (2 * var(--gutter)));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: var(--gap);
  margin: 0 auto;
  align-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

#mmfs .grid > .layer {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
}

#mmfs .grid > .layer:nth-of-type(1) div:nth-of-type(odd) {
  grid-column: 1;
}

#mmfs .grid > .layer:nth-of-type(1) div:nth-of-type(even) {
  grid-column: -2;
}

#mmfs .grid > .layer:nth-of-type(2) div:nth-of-type(odd) {
  grid-column: calc(2 + var(--offset));
}

#mmfs .grid > .layer:nth-of-type(2) div:nth-of-type(even) {
  grid-column: calc(-3 - var(--offset));
}

#mmfs .grid > .layer:nth-of-type(3) div:first-of-type {
  grid-column: calc(3 + var(--offset));
  grid-row: 1;
}

#mmfs .grid > .layer:nth-of-type(3) div:last-of-type {
  grid-column: calc(3 + var(--offset));
  grid-row: -1;
}

#mmfs .grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1rem;
}

#mmfs .grid .scaler {
  position: relative;
  grid-area: 2 / calc(3 + var(--offset));
}

#mmfs .scaler {
  z-index: 2;
  width: 100%;
  height: 100%;
  position: relative;
  isolation: isolate;
}

#mmfs .scaler > picture {
  position: absolute;
  inset: 0;
}

#mmfs .mmfs__hero-background {
  z-index: 1;
  transform: translateZ(0);
}

#mmfs .scaler > picture > img {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  object-fit: cover;
  border-radius: 0;
  width: 100%;
  height: 100%;
}

#mmfs .mmfs__hero-title {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(30vw, 28rem, 48svh);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

#mmfs .mmfs__hero-title .mmfs__logo-part {
  position: static;
  display: block;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
  translate: none;
  opacity: 0;
  will-change: transform, opacity;
}

#mmfs .mmfs__hero-title .mmfs__logo-part--top {
  width: 80%;
  margin-bottom: 8.4%;
}

#mmfs .mmfs__hero-title .mmfs__logo-part--tekst-top {
  width: 100%;
}

#mmfs .mmfs__hero-title .mmfs__logo-part--tekst-bottom {
  width: 71%;
  margin-top: 1.4%;
}

#mmfs .mmfs__intro {
  position: absolute;
  z-index: 4;
  top: auto;
  bottom: var(--mmfs-intro-bottom);
  left: clamp(1rem, 5vw, 5.5rem);
  right: clamp(1rem, 5vw, 5.5rem);
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
  padding: 0;
  color: #fff;
  text-align: left;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  text-shadow: none;
}

#mmfs .mmfs__intro-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: min(42vh, 360px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .42) 54%, rgba(0, 0, 0, .72) 100%);
  opacity: 1;
  pointer-events: none;
}

#mmfs .mmfs__intro-copy {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(.92rem, 1.1vw, 1.08rem);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0;
}

#mmfs .mmfs__intro-title {
  margin: 0;
  color: #fff !important;
  font-size: clamp(.78rem, .95vw, .95rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#mmfs .mmfs__intro-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
  line-height: inherit;
  text-decoration: none;
  border-bottom: .09em solid currentColor;
  pointer-events: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity .18s ease;
}

#mmfs .mmfs__intro-link i {
  font-size: 1.15em;
  line-height: 1;
}

#mmfs .mmfs__intro-link:focus-visible {
  opacity: .78;
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  #mmfs .mmfs__intro-link:hover {
    opacity: .78;
    text-decoration: none;
  }
}

@media (max-width: 600px) {
  #mmfs {
    --gutter: 1rem;
    --mmfs-intro-bottom: 1rem;
  }

  #mmfs .grid {
    grid-template-columns: repeat(3, 1fr);
    --offset: -1;
  }

  #mmfs .grid img {
    aspect-ratio: 4 / 10;
  }

  #mmfs .grid > .layer:nth-of-type(1) {
    display: none;
  }

  #mmfs .mmfs__intro {
    left: .85rem;
    right: .85rem;
    width: auto;
    gap: .55rem;
  }

  #mmfs .mmfs__intro-copy {
    max-width: none;
    font-size: 1rem;
    line-height: 1.35;
    max-height: calc(1.35em * 6);
    overflow: hidden;
  }

  #mmfs .mmfs__intro-link {
    padding: 0;
  }

  #mmfs .mmfs__hero-title {
    width: min(72vw, 22rem, 48svh);
  }

}

/* iPhone uses the same sticky scene as desktop. Do not combine a CSS
   view-timeline translation with the JavaScript drawing/photo timeline. */
@supports (-webkit-touch-callout: none) {
  @media (max-width:980px) {
    #mmfs { --mmfs-toolbar-offset:max(0px, calc(100lvh - 100dvh)); }
    #mmfs .mmfs__scrollstage--gallery { min-height:240lvh; }
    #mmfs .content {
      position:sticky; top:0; height:100lvh; min-height:100lvh;
      animation:none; translate:none;
    }
    #mmfs .mmfs__intro {
      bottom:calc(var(--mmfs-intro-bottom) + var(--mmfs-toolbar-offset) + env(safe-area-inset-bottom, 0px));
    }
  }
}

/* Only the entrance from the intro photo into the scroll showcase.
   The existing clip wrapper rounds the sheet; its transparent parent
   lets the real intro photo show through both corners. */
.home-page:has(#mmfs-content) {
  --mmfs-entrance-radius: 3rem;
}

.home-page:has(#mmfs-content) #top {
  z-index: 0;
}

.home-page #mmfs-content {
  position: relative;
  margin-top: calc(-1 * var(--mmfs-entrance-radius));
}

html .home-page #mmfs {
  background: transparent;
}

.home-page #mmfs .mmfs__wrap {
  border-radius: var(--mmfs-entrance-radius) var(--mmfs-entrance-radius) 0 0;
}

.home-page:has(#mmfs-content) #top .mm-home-intro-controls {
  bottom: calc(1.75rem + var(--mmfs-entrance-radius) + env(safe-area-inset-bottom, 0px) + var(--mm-home-toolbar-offset, 0px));
}

@media (max-width: 700px) {
  .home-page:has(#mmfs-content) {
    --mmfs-entrance-radius: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mmfs .mmfs__hero-title .mmfs__logo-part {
    opacity: 1;
    transform: none;
    will-change: auto;
  }
}

/* The scroll-driven wordmark keeps its original proportions. */
#mmfs .mmfs__hero-title > svg { display:block; width:100%; height:auto; overflow:visible; }

/* Finished wordmark is independent of the animated inline SVG's mask layer. */
#mmfs .mmfs__hero-title > img.mmfs__completed-logo {
  position:absolute; inset:0; display:block; width:100%; height:100%;
  aspect-ratio:468 / 259; object-fit:contain; border-radius:0;
  translate:none; pointer-events:none;
}
