/* The preview nav: big links on a white page, an arrow by the current one and the card that follows the pointer. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #161616;           /* the links */
  --card-w: 220px;          /* the card's size */
  --card-h: 270px;
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Radio Canada Big Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.pv {
  position: relative;
  padding-left: 0.62em;
  font-size: clamp(40px, 7.4vw, 86px);
}

.pv__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* pointed at, a link moves over a little and takes its colour, and the others step back */
.pv__link {
  display: block;
  padding: 0.04em 0.1em;
  color: var(--ink);
  font-weight: 560;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-decoration: none;
  transition: color 0.35s ease, opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.pv[data-hover] .pv__link {
  opacity: 0.22;
}

.pv[data-hover] .pv__link.is-hover {
  opacity: 1;
  color: var(--c);
  transform: translateX(0.12em);
}

.pv__link:focus {
  outline: none;
}

.pv__link:focus-visible {
  outline: 3px solid var(--c);
  outline-offset: 2px;
  border-radius: 8px;
}

/* the arrow by the current page */
.pv__here {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.46em;
  height: 0.46em;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the card: it lives in the window, not in the nav, and lets the pointer through */
.pv__card {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 20px;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.35);
  transform-origin: 30% 50%;
}

.pv__panel {
  position: relative;
  height: var(--card-h);
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
}

.pv__panel svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
}

.pv__cap {
  margin: 0;
  padding: 0 18px 16px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

/* with less motion the word pointed at changes colour, and the others step back, without moving */
@media (prefers-reduced-motion: reduce) {
  .pv__link {
    transition: color 0.2s ease, opacity 0.2s ease;
  }

  .pv[data-hover] .pv__link.is-hover {
    transform: none;
  }
}

@media (max-width: 600px) {
  :root {
    --card-w: 150px;
    --card-h: 186px;
  }

  .pv__cap {
    padding: 0 12px 11px;
    font-size: 12px;
  }
}
