:root {
  color-scheme: dark;
  background: #101110;
}

@property --portrait-presence {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

@property --spotlight {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

* { box-sizing: border-box; }

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  block-size: 100vh;
  block-size: 100svh;
  min-block-size: 18rem;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 43%, #2a2d25 0%, #1a1c18 34%, transparent 72%),
    #101110;
}

.stage {
  display: grid;
  place-items: center;
  container-type: size;
  min-inline-size: 0;
  min-block-size: 0;
  overflow: clip;
}

.field {
  position: relative;
  inline-size: min(98vw, 1550px, 184cqh);
  aspect-ratio: 1.84;
}

.portrait {
  --portrait-presence: var(--rest, .84);
  --spotlight: 0;
  position: absolute;
  inset: var(--y) auto auto var(--x);
  display: block;
  inline-size: var(--size);
  block-size: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  box-shadow: 0 0 0 1px #f4f0de24, 0 1.2rem 3.4rem #0708078c;
  opacity: calc(var(--portrait-presence) + (1 - var(--portrait-presence)) * var(--spotlight));
  translate: -50% -50%;
  transform: rotate(var(--tilt, 0deg));
}

.trio {
  --x: 50%; --y: 49%; --size: 27%; --tilt: -4deg;
  --rest: 1; --dim: .77; --duration: 23s; --phase: -11s; --rise: -8%;
  --lift: 1.065;
  z-index: 1;
}

.commander {
  --x: 32%; --y: 25%; --size: 13%; --tilt: -10deg;
  --dim: .24; --duration: 19s; --phase: -8s; --rise: -14%;
}

.navigator {
  --x: 72%; --y: 33%; --size: 16%; --tilt: 10deg;
  --dim: .32; --duration: 21s; --phase: -13s; --rise: -12%;
}

.operator {
  --x: 26%; --y: 62%; --size: 15%; --tilt: -9deg;
  --dim: .36; --duration: 25s; --phase: -13s; --rise: -13%;
}

.director {
  --x: 68%; --y: 75%; --size: 13%; --tilt: 9deg;
  --dim: .24; --duration: 18s; --phase: -10s; --rise: -10%;
}

.raven {
  --x: 15%; --y: 35%; --size: 8.5%; --tilt: -14deg;
  --dim: .12; --duration: 17s; --phase: -3s; --rise: -17%;
}

.cat {
  --x: 36%; --y: 85%; --size: 8%; --tilt: -13deg;
  --dim: .13; --duration: 20s; --phase: -8s; --rise: -15%;
}

.owl {
  --x: 85%; --y: 61%; --size: 9.5%; --tilt: 14deg;
  --dim: .16; --duration: 22s; --phase: -8s; --rise: -16%;
}

@media (prefers-reduced-motion: no-preference) {
  .portrait { animation: drift var(--duration) var(--phase) ease-in-out infinite; }
}

@media (hover: hover) and (pointer: fine) {
  .portrait:hover {
    --spotlight: 1;
    z-index: 2;
    box-shadow: 0 0 0 1px #f4f0de59, 0 1.4rem 4rem #070807b3, 0 0 2.6rem #c0c6a229;
  }

  .field:has(.portrait:hover) .portrait:not(:hover) {
    filter: brightness(.72) saturate(.82);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .portrait {
    transition: --spotlight 360ms ease, scale 360ms ease, filter 360ms ease, box-shadow 360ms ease;
  }

  .portrait:hover {
    animation-play-state: paused;
    scale: var(--lift, 1.1);
  }
}

@keyframes drift {
  0%, 100% {
    --portrait-presence: var(--dim);
    transform: translateY(5%) rotate(calc(var(--tilt) - 2deg)) scale(.92);
  }
  48%, 60% {
    --portrait-presence: 1;
    transform: translateY(var(--rise)) rotate(calc(var(--tilt) + 2deg)) scale(1.035);
  }
}

footer {
  padding: 12px 16px max(22px, env(safe-area-inset-bottom));
  color: #a9a89e;
  text-align: center;
  font: 400 .6875rem/1.4 "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .1em;
}

.teaser-note {
  margin-block-end: .625rem;
  color: #88897f;
}

.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .125rem;
}

.profile-link {
  display: inline-grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  margin-block: -4px;
  border-radius: 4px;
  color: inherit;
}

.profile-link:is(:hover, :focus-visible) { color: #f4f0de; }
.profile-link:focus-visible { outline: 1px solid currentColor; }

@media (max-aspect-ratio: 1/1) {
  .field { inline-size: min(100vw, 65cqh, 640px); aspect-ratio: .75; }
  .trio { --x: 50%; --y: 46%; --size: 49%; }
  .commander { --x: 27%; --y: 19%; --size: 24%; }
  .navigator { --x: 70%; --y: 20%; --size: 26%; }
  .operator { --x: 23%; --y: 72%; --size: 26%; }
  .director { --x: 70%; --y: 73%; --size: 25%; }
  .raven { --x: 13%; --y: 49%; --size: 14%; }
  .cat { --x: 44%; --y: 88%; --size: 16%; }
  .owl { --x: 86%; --y: 51%; --size: 16%; }
}
