/* Floating project pieces (js/backdrop.js). Each host section is its own stacking context; the layer sits
   behind the section's content, spans the full screen width and is clipped to the section. */
[data-backdrop] { position: relative; isolation: isolate; }
.hero[data-backdrop] { z-index: 2; } /* the game panel hangs below the hero, so the hero paints above Start here */

.backdrop {
  position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%;
  width: 100vw; translate: -50% 0;
  overflow: clip;
  pointer-events: none;
  user-select: none;
}

/* Anchored layers: a zero-height strip right before a panel, painted behind every panel in the section. */
.backdrop--anchor { position: relative; top: auto; bottom: auto; height: 0; overflow-x: clip; overflow-y: visible; }
.project + .backdrop--anchor { margin-top: clamp(40px, 6vw, 96px); }

.bp {
  position: absolute;
  width: var(--w);
  transform: rotate(var(--rot, 0deg));
  will-change: transform;
}
/* Depth: far pieces are faint and soft, near ones clearer. */
.bp--d1 { opacity: .14; filter: blur(1.5px); }
.bp--d2 { opacity: .22; }
.bp--d3 { opacity: .3; }
.robotics .bp--d1, .foot .bp--d1 { opacity: .08; }
.robotics .bp--d2, .foot .bp--d2 { opacity: .11; }
.robotics .bp--d3, .foot .bp--d3 { opacity: .14; }

/* Code lines from Loopback */
.bp-code {
  display: block; width: auto; max-width: var(--w);
  padding: .55em 1em; border-radius: 10px;
  background: #1b2433; color: #a9cdf6; border: 1px solid rgba(74, 138, 214, .45);
  font: 500 calc(var(--w) / 14) / 1.3 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

/* Recall flashcards */
.bp-card {
  display: grid; align-content: space-between; gap: .8em;
  aspect-ratio: 3 / 2; padding: 1em;
  border-radius: 14px;
  background: var(--paper); color: var(--paper-ink);
  font-size: calc(var(--w) / 12);
}
.bp-card-q { font-family: var(--font-display); line-height: 1.15; }
.bp-card-rate { display: flex; gap: .3em; font-size: .55em; }
.bp-card-rate span { padding: .3em .6em; border-radius: 99px; background: var(--paper-2); }
.bp-card-rate .is-good { background: var(--accent); color: var(--on-accent); }

/* Pitchy piano roll */
.bp-notes {
  display: block; position: relative; aspect-ratio: 2 / 1;
  border-radius: 12px; background: #1b2433; border: 1px solid rgba(74, 138, 214, .35);
  --row: calc(100% / 7);
}
.bp-notes b {
  position: absolute; height: 9%; width: 13%; border-radius: 3px;
  left: calc(6% + var(--i) * 11.5%); top: calc(90% - var(--s) * 13%);
  background: var(--accent);
}
.bp-playhead { position: absolute; top: 6%; bottom: 6%; left: 34%; width: 2px; background: var(--ink); opacity: .7; }

/* Robotics gears */
.bp-gear { display: block; aspect-ratio: 1; color: var(--soft); }
.bp-gear svg { width: 100%; height: 100%; fill: currentColor; }
.robotics .bp-gear, .foot .bp-gear { color: var(--paper-ink); }
.foot .bp-card { background: var(--paper-2); }

@media (max-width: 760px) {
  .hero .backdrop { display: none; } /* the phone hero is too dense for anything behind it */
  .bp--d3, .projects .bp--d3 { opacity: .2; }
  .bp { width: calc(var(--w) * .62); }
  .bp-code { max-width: calc(var(--w) * .62); font-size: calc(var(--w) * .62 / 14); }
  .bp-card { font-size: calc(var(--w) * .62 / 12); }
}

/* Panels are frosted glass: the pieces behind them stay visible, blurred, as they slide past. */
.project, .tz:not(.tz--ftc), .link-card {
  background-color: rgba(25, 25, 28, .66);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
}
.tz:not(.tz--ftc):hover { background-color: rgba(33, 32, 36, .8); }
.link-card:hover { background-color: var(--paper); }
.projects .bp--d2 { opacity: .3; }
.projects .bp--d3 { opacity: .42; }
