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

body{
  margin: 0;
  font-family: "Georgia", serif;
  background: #fff;
  color: #111;
  overflow: hidden;
}

/* ============================= */
/* HEADER */
/* ============================= */
.site-header{
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #fff;
  position: relative;
  z-index: 100;
}

.brand{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 102;
}

.brand__logo{
  height: 18px;
  width: auto;
  display: block;
}

.nav{
  display: flex;
  gap: 24px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav a{
  text-decoration: none;
  color: #222;
  opacity: 0.8;
}

.nav a:hover{
  opacity: 1;
}

/* ============================= */
/* HAMBURGER */
/* ============================= */
.nav-toggle{
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 102;
}

.nav-toggle span{
  display: block;
  width: 22px;
  height: 1.5px;
  background: #111;
  margin: 5px auto;
  transition: transform 260ms ease, opacity 260ms ease;
}

.nav-toggle.is-open span:nth-child(1){
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2){
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3){
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================= */
/* MOSAICO */
/* ============================= */
.home{
  height: calc(100vh - 70px);
  padding: 0 60px;
  display: flex;
}

.mosaic{
  width: 100%;
  flex: 1;
  position: relative;
}

.mosaic__headline{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  font-weight: 400;
  color: #111;
  text-align: center;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  opacity: 0;
  letter-spacing: .22em;
  filter: blur(12px);
  width: max-content;
  max-width: calc(100vw - 80px);
}

.mosaic__headline.is-in{
  animation: headlineSplit 1200ms cubic-bezier(.16,.95,.2,1) forwards;
}

@keyframes headlineSplit{
  0%{
    opacity: 0;
    transform: translate(-50%, -50%) scale(.98);
    letter-spacing: .28em;
    filter: blur(16px);
  }
  55%{ opacity: 1; }
  75%{
    letter-spacing: .05em;
    filter: blur(0px);
    transform: translate(-50%, -50%) scale(1.02);
  }
  100%{
    opacity: 1;
    letter-spacing: .02em;
    filter: blur(0px);
    transform: translate(-50%, -50%) scale(1);
  }
}

.mosaic__headline.dim{
  opacity: .72;
  transition: opacity 450ms ease;
}

.mosaic__headline.is-out{
  opacity: 0;
  transition: opacity 450ms ease;
}

.mosaic__viewport{
  position: relative;
  width: 100%;
  height: calc(100vh - 70px);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.mosaic__viewport.is-grabbing{
  cursor: grabbing;
}

.mosaic__viewport::before{
  content:"";
  position:absolute;
  inset:-1px;
  pointer-events:none;
  z-index: 5;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255,255,255,0) 55%, rgba(0,0,0,.06) 100%);
  opacity: .75;
}

.mosaic__content{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  will-change: transform;
  transform: translate3d(0,0,0);
  transform-origin: 50% 0%;
}

/* ============================= */
/* GRID */
/* ============================= */
.mosaic__grid{
  column-count: var(--cols, 6);
  column-gap: 14px;
  padding: 16px 8px 16px;
  width: 100%;
}

.tile{
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateZ(0);
  backface-visibility: hidden;
  position: relative;
  z-index: 1;
  transition: opacity 320ms ease;
}

.tile:hover{
  z-index: 10;
}

.mosaic-ready .tile{
  opacity: 1;
}

.tile img{
  width: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.5;
  cursor: pointer;

  --mx: 0px;
  --my: 0px;
  --hScale: 1;
  --cinX: 0px;
  --cinY: 0px;

  transform: translate3d(calc(var(--mx) + var(--cinX)), calc(var(--my) + var(--cinY)), 0) scale(var(--hScale));
  transition:
    transform 520ms cubic-bezier(.16,.95,.2,1),
    filter 520ms cubic-bezier(.16,.95,.2,1),
    opacity 520ms cubic-bezier(.16,.95,.2,1);
  will-change: transform, filter, opacity;
}

.tile::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: radial-gradient(120% 120% at 50% 30%, rgba(255,255,255,.10), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 520ms cubic-bezier(.16,.95,.2,1);
}

.tile:hover img{
  --hScale: 1.06;
  filter: grayscale(60%);
  opacity: 0.96;
}

.tile:hover::after{
  opacity: 1;
}

.mosaic__grid.is-hovering .tile{
  opacity: 0.86;
}

.mosaic__grid.is-hovering .tile:hover{
  opacity: 1;
}

/* ============================= */
/* RESPONSIVE DESKTOP / NOTEBOOK */
/* ============================= */
@media (max-width: 1400px){
  .home{ padding: 0 40px; }
  .mosaic__grid{ column-gap: 12px; padding: 14px 6px 14px; }
  .tile{ margin-bottom: 12px; }
}

@media (max-width: 1100px){
  .site-header{ padding: 0 28px; }
  .home{ padding: 0 28px; }
  .mosaic__grid{ column-gap: 10px; padding: 12px 5px 12px; }
  .tile{ margin-bottom: 10px; }

  .mosaic__headline{
    font-size: 32px;
  }
}

/* ============================= */
/* MOBILE */
/* ============================= */
@media (max-width: 768px){
  html, body{
    height: auto;
    min-height: 100%;
  }

  body{
    overflow-x: hidden;
    overflow-y: auto;
  }

  .site-header{
    height: 70px;
    padding: 0 18px;
    position: sticky;
    top: 0;
  }

  .nav-toggle{
    display: inline-block;
  }

  .nav{
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 22px 20px 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity 220ms ease,
      transform 220ms ease,
      visibility 220ms ease;
    z-index: 101;
  }

  .nav.is-open{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a{
    font-size: 12px;
    letter-spacing: .12em;
  }

  .home{
    height: auto;
    min-height: unset;
    display: block;
    padding: 0 16px 28px;
  }

  .mosaic{
    position: relative;
  }

  .mosaic__headline{
    position: fixed;
    top: 50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 40px);
    max-width: 340px;
    white-space: normal;
    font-size: 22px;
    line-height: 1.35;
    letter-spacing: .10em;
    text-align: center;
    z-index: 20;
  }

  .mosaic__viewport{
    height: auto;
    overflow: visible;
    cursor: default;
    touch-action: auto;
  }

  .mosaic__viewport::before{
    display: none;
  }

  .mosaic__content{
    position: relative;
    transform: none !important;
    width: 100%;
  }

  .mosaic__grid{
    column-count: 1 !important;
    column-gap: 0;
    padding: 24px 0 0;
  }

  .tile{
    margin: 0 0 14px;
    opacity: 1;
  }

  .tile img{
    transform: none !important;
    filter: grayscale(100%);
    opacity: 0.58;
  }

  .tile:hover img{
    transform: none !important;
    filter: grayscale(100%);
    opacity: 0.58;
  }

  .tile::after{
    display: none;
  }

  .mosaic__grid.is-hovering .tile,
  .mosaic__grid.is-hovering .tile:hover{
    opacity: 1;
  }

  .mosaic__headline.is-out{
    opacity: .9;
  }
}

/* ============================= */
/* ACCESSIBILITY */
/* ============================= */
@media (prefers-reduced-motion: reduce){
  .mosaic__headline.is-in{
    animation: none;
    opacity: 1;
    filter: none;
  }

  .mosaic__viewport::before{
    opacity: 0;
  }
}

/* ============================= */
/* LIGHTBOX */
/* ============================= */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: rgba(10,10,10,.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.lightbox.is-open{
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img{
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 70px rgba(0,0,0,.45);
  background: #111;
  filter: none !important;
  opacity: 1 !important;
  transform: scale(.98);
  transition: transform 220ms cubic-bezier(.16,.95,.2,1);
}

.lightbox.is-open .lightbox__img{
  transform: scale(1);
}

.lightbox__close{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close:hover{
  background: rgba(0,0,0,.55);
}

/* ============================= */
/* OVERLAY FLY */
/* ============================= */
.fly-layer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.fly-tile{
  position: absolute;
  overflow: hidden;
}

.fly-tile img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.5;
}