/* The profile in the black hole: one fixed screen. The canvas draws the strip, the floor and the hole;
   the profile's text is ordinary HTML laid over the middle of the hole. */
:root {
  --ink: #ffffff;
  --soft: rgba(255, 255, 255, 0.6);
  --hole: min(40vw, 62vh);            /* the hole's diameter: the script reads it from the profile's box */
  --edge: clamp(20px, 5.4vw, 80px);   /* the margin of the brand, the button and the captions */
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  /* black is part of the effect: the canvas clears to it and the hole is made of it */
  background: #000;
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* the finger moves the strip sideways; pinching still zooms */
.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  transition: opacity 0.7s ease;
}
.is-ready .stage__canvas {
  opacity: 1;
}
.is-dragging .stage__canvas {
  cursor: grabbing;
}
.is-open .stage__canvas {
  cursor: default;
}

/* ---------------------------------------------------------------- the frame: brand, button, captions */
.bar,
.foot {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.bar {
  top: clamp(18px, 4.4vh, 44px);
}
.foot {
  bottom: clamp(18px, 4.4vh, 44px);
}
.brand,
.toggle,
.foot p,
.profile__facts,
.profile__links a {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.foot p:first-child {
  color: var(--soft);
}
.toggle {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.3s ease-out;
  -webkit-tap-highlight-color: transparent;
}
/* a bigger target than the word */
.toggle::before {
  content: '';
  position: absolute;
  inset: -16px;
}
.toggle:focus-visible,
.profile__links a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 6px;
}
@media (hover: hover) {
  .toggle:hover,
  .profile__links a:hover {
    opacity: 0.6;
  }
}

/* ---------------------------------------------------------------- the series, for readers only while the canvas draws them */
.series {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  list-style: none;
}

/* ---------------------------------------------------------------- the profile, in the middle of the hole */
.profile {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: var(--hole);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.is-open .profile {
  pointer-events: auto;
}
.profile__inside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 13%;
  text-align: center;
  visibility: hidden;
}
.is-open .profile__inside,
.is-closing .profile__inside {
  visibility: visible;
}
.profile__text {
  margin: 0;
  font-size: clamp(13px, 1.02vw, 16px);
  line-height: 1.38;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.profile__facts {
  margin-top: clamp(16px, 2vw, 28px);
  color: var(--soft);
}
.profile__row {
  margin-top: clamp(16px, 2vw, 28px);
  overflow: clip;
}
.profile__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.profile__links a {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease-out;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- without the lens
   Reduced motion, or a browser with no WebGL: the hole is a plain black disc that fades in, and the text is just there.
   With no WebGL at all the pictures become a row you scroll sideways. */
.is-still .profile,
.is-flat .profile {
  background: #000;
  opacity: 0;
  transition: opacity 0.25s linear;
}
.is-still.is-open .profile,
.is-flat.is-open .profile {
  opacity: 1;
}
.is-flat .stage__canvas {
  display: none;
}
.is-flat .series {
  position: absolute;
  inset: 50% 0 auto;
  display: flex;
  gap: 12px;
  width: auto;
  height: 44vh;
  margin: 0;
  padding: 0 var(--edge);
  overflow-x: auto;
  clip-path: none;
  transform: translateY(-50%);
}
.is-flat .series li {
  position: relative;
  flex: none;
  height: 100%;
}
.is-flat .series canvas {
  display: block;
  height: 100%;
  border-radius: 18px;
}
.is-flat .series h2,
.is-flat .series p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------------------------------------------------------------- phone: a hole almost as wide as the screen */
@media (max-width: 650px) {
  :root {
    --hole: min(88vw, 58vh);
  }
  .profile__inside {
    padding: 0 11%;
  }
  .profile__text {
    font-size: 13px;
  }
}
