:root { color-scheme: dark; --text: #f7f2f0; --animation: 250ms cubic-bezier(0.2, 0.7, 0.18, 1); }
* { box-sizing: border-box; }
html { background: #020202; color: var(--text); }
body { margin: 0; font-family: "Courier New", Courier, monospace; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.portfolio-board { min-height: 100vh; padding: 26px 0 34px; }
.pcb-shell { position: relative; width: min(calc(100% - 34px), 1440px); margin-inline: auto; isolation: isolate; }
.pcb-art { display: block; pointer-events: none; user-select: none; }
.pcb-art, .pcb-art img { width: 100%; }
.pcb-art img { aspect-ratio: 1309 / 2133; }

/* Centers use the full SVG viewBox, including its outer margin. */
.project-card, .contact-link {
  --closed-width: var(--w-desktop);
  --open-width: var(--open-desktop);
  position: absolute;
  left: var(--x-desktop);
  top: var(--y-desktop);
  width: var(--closed-width);
  transform: translate(-50%, -50%);
}
.project-card { z-index: 3; display: block; text-decoration: none; touch-action: manipulation; transition: width var(--animation), transform var(--animation); }
.project-card > img { width: 100%; height: auto; }
.project-card.is-active { width: var(--open-width); z-index: 30; }
.project-card:focus-visible, .contact-link:focus-visible { outline: 1px solid var(--text); outline-offset: 5px; }
.project-copy {
  position: absolute;
  z-index: 2;
  left: var(--copy-x);
  top: var(--copy-y);
  width: var(--copy-width);
  padding: 8px 0;
  text-align: var(--copy-align);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity var(--animation), transform var(--animation), visibility 0s linear 250ms;
}
.project-card.is-active .project-copy { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.project-title, .project-desc, .project-cta {
  display: block; font-weight: 700; letter-spacing: 0;
  text-shadow: 2px 0 #020202, -2px 0 #020202, 0 2px #020202, 0 -2px #020202;
}
.project-title { margin-bottom: 6px; font-size: 16px; line-height: 1.2; }
.project-desc { font-size: 15px; line-height: 1.25; }
.project-cta { width: fit-content; margin: 10px auto 0; padding: 5px 8px; border: 1px solid #f7f2f0; background: #020202; font-size: 12px; line-height: 1.2; }
.project-card--about .project-copy { top: auto; bottom: 100%; }
.project-card--buggy .project-copy, .project-card--powertrain .project-copy { left: 100%; }
.project-card--suite .project-copy { left: -72%; }
.project-card--welding .project-copy, .project-card--pcb .project-copy, .project-card--fpga .project-copy { top: 100%; }
.contact-cluster { display: contents; }
.contact-link { z-index: 4; transition: filter var(--animation); }
.contact-link img { width: 100%; }
.contact-link:hover { filter: brightness(1.22); }

@media (min-width: 1440px) {
  .pcb-shell {
    transform: translateX(3.4%);
  }

  .portfolio-board {
    overflow-x: clip;
  }
}

@media (min-width: 800px) and (max-width: 1439px) {
  .pcb-shell { width: min(calc(100% - 34px), 928px); }
  .pcb-art img { aspect-ratio: 800 / 1208; }
  .project-card, .contact-link {
    --closed-width: var(--w-tablet); --open-width: var(--open-tablet);
    left: var(--x-tablet); top: var(--y-tablet);
  }
  .project-card--fpga.is-active { transform: translate(-65%, -50%); }
  .project-card--buggy .project-copy { left: 50%; top: 100%; width: 100%; margin-left: -50%; }
  .project-title { font-size: 15px; }
  .project-desc { font-size: 14px; }
}
@media (max-width: 799px) {
  .portfolio-board { padding: 16px 0 24px; }
  .pcb-shell { width: min(calc(100% - 18px), 430px); }
  .pcb-art img { aspect-ratio: 375 / 599; }
  .project-card, .contact-link {
    --closed-width: var(--w-mobile); --open-width: var(--open-mobile);
    left: var(--x-mobile); top: var(--y-mobile);
  }
  .project-card--fpga.is-active { transform: translate(-80%, -50%); }
  .project-card--pcb.is-active { transform: translate(-35%, -50%); }
  .project-card .project-copy { left: 50%; top: 100%; bottom: auto; width: 160px; max-width: 200%; margin-left: 0; text-align: center; transform: translate(-50%, 6px); }
  .project-card.is-active .project-copy { transform: translate(-50%, 0); }
  .project-card--fpga .project-copy { left: auto; right: 0; }
  .project-card--fpga.is-active .project-copy { transform: none; }
  .project-card--pcb .project-copy { left: 0; }
  .project-card--pcb.is-active .project-copy { transform: none; }
  .project-title { font-size: 13px; }
  .project-desc { font-size: 12px; }
  .project-cta { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
}
