/* =========================================================
   garrett michaud — main page
   White page, huge blue name, a looping video, a scatter of photos.
   Measurements are taken from the Cargo version of this page.
   ========================================================= */

:root {
  --blue: rgba(8, 0, 255, 0.47);   /* the see-through blue of the name */
  --blue-solid: #0800ff;           /* for small text, so it stays readable */
  /* Akzidenz Grotesk (the Cargo font) is a paid font, so we use the closest
     one every computer already has. */
  --sans: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
}

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

html { background: #fff; }
body {
  margin: 0;
  background: #fff;
  color: var(--blue-solid);
  font-family: var(--sans);
  overflow-x: hidden;
}
::selection { background: var(--blue-solid); color: #fff; }

/* ---------- the stage ----------
   On a computer it keeps the same proportions as the Cargo page (1273 x 772),
   so everything scales together as the window gets wider or narrower. */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1273 / 772;
  overflow: hidden;
  container-type: inline-size;       /* lets us size things in "cqw" = 1% of stage width */
}

/* ---------- video: left half, 16:9 ---------- */
.video {
  position: absolute;
  left: 0;
  top: 26.8%;
  width: 50%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  z-index: 1;
}
.video iframe {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 212%;                      /* taller than the box, then centered: crops YouTube's title bar */
  transform: translateY(-50%);
  border: 0;
  pointer-events: none;              /* it's a background loop, not a player */
}

/* pause / play button in the middle of the video */
.video-toggle {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.25s, background 0.25s;
}
.video-toggle:hover,
.video-toggle:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.35); }
.video-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* the two white bars (pause). When paused it turns into a triangle (play). */
.video-toggle .bars {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 20px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-left: 7px solid #fff;
  border-right: 7px solid #fff;
}
.video-toggle[aria-pressed="true"] .bars {
  width: 0;
  height: 0;
  border: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 21px solid #fff;
  transform: translate(-38%, -50%);
}

/* ---------- photos ----------
   left / top / width are percentages of the stage.
   Change these numbers to move a photo around. Higher z-index = on top. */
.photo {
  position: absolute;
  display: block;
  line-height: 0;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.photo img { display: block; width: 100%; height: auto; }

.p-tree     { left: 59.8%; top: 12.0%; width: 14.0%; z-index: 1; animation-delay: 0.05s; }
.p-graffiti { left: 71.1%; top: 17.1%; width: 13.0%; z-index: 2; animation-delay: 0.15s; }
.p-hardhat  { left: 52.1%; top: 25.2%; width: 12.5%; z-index: 3; animation-delay: 0.25s; }
.p-collage  { left: 80.7%; top: 61.6%; width: 15.9%; z-index: 3; animation-delay: 0.35s; }
.p-forest   { left: 88.1%; top: 49.6%; width: 12.1%; z-index: 4; animation-delay: 0.45s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@media (hover: hover) {
  .photo { transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .photo:hover { transform: translateY(-5px) scale(1.03); z-index: 20; }
}
.photo:focus-visible { outline: 2px solid var(--blue-solid); outline-offset: 3px; z-index: 20; }

/* ---------- the name ---------- */
.name {
  position: absolute;
  left: 8.4%;
  top: 35.2%;
  width: 90%;
  margin: 0;
  z-index: 10;
  pointer-events: none;              /* photos underneath stay clickable */
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15.7vw;                 /* fallback. Cargo used 15.22, bumped a touch because Helvetica is a bit narrower than Akzidenz */
  font-size: 15.7cqw;
  line-height: 1;
  letter-spacing: -0.113em;          /* the squeezed-together look */
  white-space: nowrap;
  color: var(--blue);
}

/* ---------- links to the other pages ---------- */
.go {
  position: absolute;
  left: 8.4%;
  bottom: 5%;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 1.8rem;                /* 28px = wrapped rows never overlap each other's tap area */
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.go a {
  display: inline-block;
  padding: 14px 6px;               /* makes the tap area 44px+ tall on a phone... */
  margin: -14px -6px;              /* ...without moving the text */
  color: var(--blue-solid);
  text-decoration: none;
}
.go a:hover,
.go a:focus-visible { text-decoration: underline; text-underline-offset: 0.25em; outline: none; }

/* =========================================================
   PHONES: same pieces, stacked taller. Sizes here are in
   "cqw" (1% of the screen width) so it scales with the phone.
   ========================================================= */
@media (max-width: 760px) {
  .stage { aspect-ratio: auto; height: 240vw; }
  .go { gap: 28px 1.1rem; }       /* tighter on phones so 3 links fit on one row */

  .video { top: 9cqw; width: 100%; }

  .name {
    left: 5cqw;
    top: 41cqw;
    width: 92cqw;
    font-size: 30cqw;
    line-height: 0.92;
    white-space: normal;
  }
  .name span { display: block; }

  .p-tree     { left: 6cqw;  top: 108cqw; width: 40cqw; }
  .p-graffiti { left: 45cqw; top: 121cqw; width: 47cqw; }
  .p-hardhat  { left: 3cqw;  top: 141cqw; width: 40cqw; }
  .p-collage  { left: 52cqw; top: 153cqw; width: 43cqw; }
  .p-forest   { left: 6cqw;  top: 183cqw; width: 46cqw; }

  .go { left: 5cqw; bottom: 5cqw; }
}

/* Respect people who ask their device for less motion */
@media (prefers-reduced-motion: reduce) {
  .photo { animation: none; }
  .photo, .video-toggle { transition: none; }
}
