@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  font-style: normal;
}

:root {
  --gap: 10px;
  --radius: 20px;
  --accent: #00d8ff;
  --bg: #0f1216;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: #fff;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "one two"
    "three three";
  gap: var(--gap);
  height: 100%;
  padding: var(--gap);
}

.panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.panel--micky {
  grid-area: one;
}

.panel--franc {
  grid-area: two;
}

.panel--felix {
  grid-area: three;
}

/* Background image on its own layer so it can zoom without moving the label. */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s var(--ease);
}

.panel--micky::before {
  background-image: url(micky.jpg);
}

.panel--franc::before {
  background-image: url(franc.jpg);
}

.panel--felix::before {
  background-image: url(felix.jpg);
}

/* Darkening gradient for legible text; lightens on interaction. */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55),
    rgba(15, 18, 22, 0.45)
  );
  transition: background 0.5s var(--ease);
}

.panel:hover::before,
.panel:focus-visible::before {
  transform: scale(1.06);
}

.panel:hover::after,
.panel:focus-visible::after {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.4),
    rgba(15, 18, 22, 0.2)
  );
}

.panel__name {
  position: relative;
  padding-bottom: 0.15em;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7.5vw, 5.5rem);
  font-weight: 600;
  color: #FFFFE3;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
}

/* Accent underline that grows in from the centre on hover/focus. */
.panel__name::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.4s var(--ease);
}

.panel:hover .panel__name::after,
.panel:focus-visible .panel__name::after {
  width: 2.2em;
}

.panel:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* Staggered entrance. */
@media (prefers-reduced-motion: no-preference) {
  .panel {
    animation: rise 0.7s var(--ease) both;
  }

  .panel--franc {
    animation-delay: 0.08s;
  }

  .panel--felix {
    animation-delay: 0.16s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* Stack to a single column on phones. */
@media (max-width: 640px) {
  .wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "one"
      "two"
      "three";
  }
}
