/* feestvideo.nl: one page in the colours of the logo. The logo itself is made of the party
   videos: small screens inside its shapes, under the colours of the logo (assets/site.js).
   This file's default look, without JavaScript, is the plain logo. */

:root {
  --purple: #3b0257;
  --orange: #f36f21;
  --tint: 0.78;  /* how much of the videos the colours of the logo hide */
  --mark-h: min(46svh, 118vw);          /* height of the logo mark */
  --mark-w: calc(var(--mark-h) * 0.6767);  /* the mark is 229 wide on 338 high */
  --u: calc(var(--mark-w) / 229.02);       /* one unit of the logo drawing, on screen */
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: "Red Hat Display", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #fff;
  background: var(--purple);
}

.stage {
  min-height: 100svh;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4svh, 44px);
}

/* ---------- The mark ---------- */

.mark {
  position: relative;
  flex: none;
  width: var(--mark-w);
  height: var(--mark-h);
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.mark:focus-visible { outline: 2px solid var(--orange); outline-offset: 12px; }

/* The videos lie on the three faces of the logo. Every face is a flat grid of small screens
   that is tilted into the perspective of that face (the logo is drawn isometric: edges at 30
   degrees) and cut out along the shape of the face. Places and sizes are in units of the logo
   drawing, measured from its top left corner. */
.clips,
.face {
  position: absolute;
  inset: 0;
}

.face-top  { clip-path: url(#clip-top); }
.face-side { clip-path: url(#clip-side); }
.face-f    { clip-path: url(#clip-f); }

.face-grid {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  grid-auto-rows: 1fr;
  transform-origin: 0 0;
}

/* top: lying flat; side: the wall running back to the left; f: the front wall */
.face-top .face-grid  { --x: -2.16;  --y: 91.53;  --w: 191; --h: 111; --columns: 3; transform: matrix(0.866, -0.5, 0.866, 0.5, 0, 0); }
.face-side .face-grid { --x: -0.87;  --y: 89.95;  --w: 111; --h: 211; --columns: 2; transform: matrix(0.866, 0.5, 0, 1, 0, 0); }
.face-f .face-grid    { --x: 124.75; --y: 164.53; --w: 101.5; --h: 122; --columns: 2; transform: matrix(0.866, -0.5, 0, 1, 0, 0); }

.clips video {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.mark-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mark-fill { fill: #fff; transition: opacity 0.9s; }
.mark-top  { fill: var(--orange); }
.mark-side { transition-delay: 0.2s; }
.mark-f    { transition-delay: 0.4s; }

/* With the videos underneath, the colours of the logo let them shine through. */
.has-clips .mark-fill { opacity: var(--tint); }

/* ---------- Name, line and mail address ---------- */

.caption {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  transition: opacity 0.9s;
}

h1 { margin: 0; line-height: 0; }

.wordmark { width: min(300px, 70vw); height: auto; fill: currentColor; }

.tagline {
  margin: 0;
  font-size: clamp(14px, 2.2svh, 18px);
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.contact {
  margin-top: 6px;
  font-size: clamp(14px, 2svh, 16px);
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contact:hover,
.contact:focus-visible { border-color: currentColor; outline: none; }

/* ---------- The opening (class set by site.js) ----------
   is-building: the screens pop up one by one and form the logo, still without its colours.
   After that the colours come over them and the name appears. */

.is-building .mark-fill,
.is-building .caption { opacity: 0; transition: none; }

.caption { transition-delay: 0.7s; }

.is-building .clips video { animation: pop 0.45s var(--pop-delay, 0ms) backwards; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.4); }
}

/* Low screens (phone on its side): logo and text next to each other. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --mark-h: 70svh; }
  .stage { flex-direction: row; gap: 8vw; }
  .caption { align-items: flex-start; text-align: left; }
}
