/* Entrepreneurship Days — placeholder page.
 * One typeface (Mona Sans, variable weight + width), colours taken from the
 * BBS am Museumsdorf logo: the signet blue and the six two-tone department tiles.
 * No external requests: font and images are served from this host. */

@font-face {
  font-family: "Mona Sans";
  src: url("fonts/mona-sans-latin-standard-normal.woff2") format("woff2-variations"),
       url("fonts/mona-sans-latin-standard-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #F6F7F9;
  --ink: #22252B;
  --muted: #565C66;
  --line: #C6CCD5;
  --signet: #055CA6;

  /* Department tiles: top-left half / bottom-right half, as in the logo. */
  --c1a: #3361AA; --c1b: #14142D;
  --c2a: #228947; --c2b: #16321B;
  --c3a: #A27CB5; --c3b: #C999C5;
  --c4a: #FDCA36; --c4b: #F8F099;
  --c5a: #EA6619; --c5b: #F29719;
  --c6a: #E32014; --c6b: #983333;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --font: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 420;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--c4b); color: var(--ink); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
a:hover { color: var(--signet); text-decoration-color: currentColor; }
a:focus-visible {
  outline: 3px solid var(--signet);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- frame */

.page {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 82rem;
  margin-inline: auto;
  padding: var(--gutter);
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: clamp(2rem, 5vw, 3rem);
}

.site-header .logo {
  display: inline-block;
  line-height: 0;
}
.site-header img {
  width: 132px;
  height: auto;
}

/* ---------------------------------------------------------------- hero */

.hero {
  align-self: center;
  /* The title is sized against the width of this box (cqi units), so the
     long word always fits its column instead of overflowing it. */
  container-type: inline-size;
  display: grid;
  grid-template-areas:
    "title"
    "mosaic"
    "copy";
  row-gap: clamp(1.75rem, 6vw, 2.5rem);
}

.title {
  grid-area: title;
  margin: 0;
  /* "Entrepreneurship" in this cut is ~6 em wide: 16cqi fills the box. */
  font-size: min(16cqi, 7.4rem);
  font-weight: 800;
  font-stretch: 75%;
  font-variation-settings: "wdth" 75;
  line-height: 0.9;
  letter-spacing: -0.012em;
}
.title span { display: block; }

.copy { grid-area: copy; }

.status {
  margin: 0;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  font-weight: 640;
  font-stretch: 100%;
}

.host {
  margin: 0.6rem 0 0;
  max-width: 46ch;
  color: var(--muted);
}

/* ---------------------------------------------------------------- mosaic
 * 6 × 4 slots. Each column keeps one department colour; the bottom row is
 * complete like the tile row of the logo, the rows above fill up, the top row
 * is still empty. One tile hovers over its slot, being put in place. */

.mosaic {
  grid-area: mosaic;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(5px, 1.1vw, 12px);
  width: 100%;
  max-width: 30rem;
}

.mosaic i {
  display: block;
  aspect-ratio: 1;
  box-shadow: inset 0 0 0 1px var(--line);
}

.mosaic .t {
  box-shadow: none;
  /* Two halves split along the rising diagonal, with a thin paper-coloured seam. */
  background: linear-gradient(
    to bottom right,
    var(--a) 0 48.4%,
    var(--paper) 48.4% 51.6%,
    var(--b) 51.6% 100%
  );
}

.c1 { --a: var(--c1a); --b: var(--c1b); }
.c2 { --a: var(--c2a); --b: var(--c2b); }
.c3 { --a: var(--c3a); --b: var(--c3b); }
.c4 { --a: var(--c4a); --b: var(--c4b); }
.c5 { --a: var(--c5a); --b: var(--c5b); }
.c6 { --a: var(--c6a); --b: var(--c6b); }

/* The tile being placed: lifted out of its slot (the empty outline stays
 * visible below it). */
.mosaic .lift {
  position: relative;
  box-shadow: inset 0 0 0 1px var(--line);
  background: none;
}
.mosaic .lift::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    var(--a) 0 48.4%,
    var(--paper) 48.4% 51.6%,
    var(--b) 51.6% 100%
  );
  transform: translate(-16%, -30%) rotate(-9deg);
  filter: drop-shadow(0 0.6rem 0.7rem rgb(34 37 43 / 0.2));
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
.legal { display: flex; gap: 1.5rem; }

/* ---------------------------------------------------------------- wide */

@media (min-width: 56rem) {
  .site-header img { width: 170px; }

  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
      "title  mosaic"
      "copy   mosaic";
    column-gap: 6cqi;
    row-gap: 2.25rem;
    align-items: end;
  }
  /* Title column = 1.35/2.35 of (100 - 6)cqi = 54cqi -> 54 / 6 em, minus a margin. */
  .title { font-size: min(8.8cqi, 7.4rem); }
  .copy { align-self: start; }
  .mosaic {
    align-self: center;
    justify-self: end;
  }
}

/* ---------------------------------------------------------------- the one moment
 * On load the tiles are set in, bottom row first; the lifted tile comes last.
 * Nothing moves afterwards. */

@media (prefers-reduced-motion: no-preference) {
  .mosaic .t:not(.lift) {
    animation: set-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--n) * 55ms + 150ms);
  }
  .mosaic .lift::after {
    animation: lift-in 700ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
    animation-delay: calc(14 * 55ms + 150ms);
  }

  .d0 { --n: 0; }  .d1 { --n: 1; }  .d2 { --n: 2; }  .d3 { --n: 3; }
  .d4 { --n: 4; }  .d5 { --n: 5; }  .d6 { --n: 6; }  .d7 { --n: 7; }
  .d8 { --n: 8; }  .d9 { --n: 9; }  .d10 { --n: 10; } .d11 { --n: 11; }
  .d12 { --n: 12; }
}

@keyframes set-in {
  from { opacity: 0; transform: translateY(-38%); }
  to   { opacity: 1; transform: none; }
}

@keyframes lift-in {
  from { opacity: 0; transform: translate(-16%, -95%) rotate(-20deg); }
  to   { opacity: 1; transform: translate(-16%, -30%) rotate(-9deg); }
}
