/* --- v1.3: project hierarchy + responsive optimization pass --- */

/* Dark project art inherits white text. Case labels should always read like paper labels. */
.case-tag {
  color: var(--ink);
  background: var(--paper);
}

/* Product tags answer "what is this?" before the technical stack answers "how was it built?" */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.product-chip {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 6px 8px;
  font: 700 .62rem "IBM Plex Mono", ui-monospace, monospace;
  line-height: 1.05;
  letter-spacing: .035em;
  white-space: nowrap;
}

.tech-stack {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tech-stack-label {
  padding-top: 5px;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #555;
  white-space: nowrap;
}

.tech-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-chip {
  border: 1px solid rgba(10,10,10,.32);
  background: transparent;
  padding: 5px 7px;
  font: 600 .58rem "IBM Plex Mono", ui-monospace, monospace;
  line-height: 1;
  color: #4a4a4a;
  white-space: nowrap;
}

/* Keep actions visually anchored at the bottom of cards in the same row. */
.project-body {
  min-width: 0;
}

.project-links {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  background: white;
  font: 700 .66rem "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .03em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.project-link-primary {
  background: var(--ink);
  color: white;
  box-shadow: 3px 3px 0 var(--spark);
}

.project-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.project-link-primary:hover {
  box-shadow: 4px 4px 0 var(--spark);
}

.project-link:focus-visible {
  outline: 3px solid var(--spark);
  outline-offset: 3px;
}

.footer-links {
  flex-wrap: wrap;
}

/* Uplink gets its own broadcast-console identity without competing with the card title. */
.uplink-visual {
  background: #0a1419;
  color: white;
}

.uplink-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(166,255,116,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166,255,116,.055) 1px, transparent 1px);
  background-size: 24px 24px;
}

.uplink-radar {
  position: absolute;
  right: 5%;
  top: 14%;
  width: 150px;
  aspect-ratio: 1;
  border: 2px solid #a6ff74;
  border-radius: 50%;
  opacity: .88;
}

.uplink-radar::before,
.uplink-radar::after,
.uplink-radar i {
  content: "";
  position: absolute;
  border: 1px solid rgba(166,255,116,.55);
  border-radius: 50%;
  inset: 18%;
}

.uplink-radar::after { inset: 36%; }
.uplink-radar i:nth-child(1) { inset: 49% 0 auto; height: 1px; border: 0; border-top: 1px solid rgba(166,255,116,.7); border-radius: 0; }
.uplink-radar i:nth-child(2) { inset: 0 auto 0 49%; width: 1px; border: 0; border-left: 1px solid rgba(166,255,116,.7); border-radius: 0; }
.uplink-radar i:nth-child(3) { inset: 9%; border-color: rgba(166,255,116,.18); }
.uplink-radar b {
  position: absolute;
  width: 9px;
  height: 9px;
  right: 28%;
  top: 31%;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 0 5px rgba(255,90,0,.18);
}

.uplink-signal {
  position: absolute;
  right: 5%;
  bottom: 9%;
  display: grid;
  gap: 3px;
  text-align: right;
  font-size: .55rem;
  color: #a6ff74;
  letter-spacing: .04em;
}

.uplink-visual .project-wordmark {
  max-width: 68%;
}

/* The arcade cabinet is intentionally loud, just not louder than the title. */
.arcade-visual .cabinet {
  right: 4%;
  top: 17%;
  width: 132px;
  height: 190px;
  padding: 11px;
}

.arcade-visual .cabinet .screen {
  height: 100px;
}

.arcade-visual .project-wordmark {
  max-width: 64%;
  font-size: clamp(3.35rem, 5.15vw, 5.7rem);
}

@media (max-width: 1180px) {
  .site-header {
    gap: 16px;
  }

  .nav {
    gap: 15px;
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  .nav {
    gap: 12px;
    font-size: .8rem;
  }
}

@media (max-width: 760px) {
  /* With Portfolio + LinkedIn moved to the footer, the mobile header can stay one compact row. */
  .site-header {
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 12px 20px;
  }

  .brand-lockup {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav {
    width: auto;
    flex: 0 0 auto;
    gap: 0;
  }

  .nav-cta {
    min-height: 40px;
    padding: 8px 10px;
    font-size: .68rem;
    white-space: nowrap;
  }

  /* Filters become one swipeable row instead of eating vertical space. */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -20px;
    padding-inline: 20px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: 0 0 auto;
  }

  .project-visual,
  .featured .project-visual {
    min-height: 270px;
  }

  .project-body {
    padding: 18px;
  }

  .project-meta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-body h3 {
    font-size: 2.45rem;
    margin-top: 17px;
  }

  .product-tags {
    margin-top: 18px;
  }

  .tech-stack {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 15px;
    padding-top: 13px;
  }

  .tech-stack-label {
    padding-top: 0;
  }

  .project-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .project-link {
    width: 100%;
    min-height: 46px;
  }

  .project-link:only-child {
    grid-column: 1 / -1;
  }

  .uplink-radar {
    width: 122px;
    right: 5%;
    top: 18%;
  }

  .uplink-visual .project-wordmark {
    max-width: 62%;
  }

  .arcade-visual .cabinet {
    width: 118px;
    height: 168px;
    right: 5%;
    top: 20%;
    padding: 9px;
  }

  .arcade-visual .cabinet .screen {
    height: 87px;
  }

  .arcade-visual .project-wordmark {
    max-width: 62%;
    font-size: clamp(3.3rem, 15vw, 5.2rem);
  }

  .footer-links {
    gap: 14px 18px;
  }
}

@media (max-width: 420px) {
  .brand-mini {
    font-size: 1.4rem;
  }

  .site-header {
    padding-inline: 16px;
  }

  .nav-cta {
    padding-inline: 9px;
    font-size: .64rem;
  }

  .project-visual,
  .featured .project-visual {
    min-height: 245px;
  }

  .project-wordmark {
    font-size: clamp(3.2rem, 18vw, 4.6rem);
  }

  .product-chip,
  .tech-chip {
    white-space: normal;
  }

  .project-links {
    grid-template-columns: 1fr;
  }

  .project-link:only-child {
    grid-column: auto;
  }

  .uplink-radar {
    width: 104px;
    top: 22%;
  }

  .uplink-signal {
    font-size: .49rem;
  }

  .uplink-visual .project-wordmark {
    max-width: 61%;
    font-size: clamp(3rem, 16vw, 4rem);
  }

  .arcade-visual .cabinet {
    width: 106px;
    height: 153px;
    top: 23%;
  }

  .arcade-visual .cabinet .screen {
    height: 77px;
    font-size: .58rem;
  }

  .arcade-visual .project-wordmark {
    max-width: 60%;
    font-size: clamp(3rem, 17vw, 4rem);
  }
}

@media (hover: none) {
  .project-card:hover {
    transform: none;
    box-shadow: none;
  }
}