/* ============================================================
   projects.css — Pureframe Labs
   Page-specific: search bar, section labels, project cards,
   status tags, progress bar.
   ============================================================ */

/* ── SEARCH ── */
.search-bar-wrap {
  margin: 36px 0 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bone-2);
  border: none;
  border-bottom: 2px solid var(--hair);
  padding: 0 4px;
  height: 48px;
  max-width: 480px;
  transition: border-color .2s, background .2s;
}

.search-bar:focus-within {
  border-color: var(--red);
  background: var(--bone-3);
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--body);
  color: var(--ink);
  background: transparent;
  flex: 1;
  padding: 0 10px;
}

.search-icon {
  font-size: 16px;
  color: var(--ink-3);
}

/* ── SECTION LABEL ── */
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label span {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.span-done {
  background: var(--ink);
}

.span-ongoing {
  background: var(--red);
}

/* ── PROJECT GRID & CARDS ── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 56px;
}

.proj-card {
  position: relative;
  isolation: isolate;
  background: var(--bone-2);
  border-top: 3px solid var(--red);
  border-radius: 14px;
  /* the grid/crosshair overlays and hover shadow are both drawn to
     the card's own box, so rounding it clips them to match rather
     than letting them poke past the curve */
  overflow: hidden;
  padding: 24px;
  transition: background .3s,
    box-shadow .45s cubic-bezier(.22, 1, .36, 1),
    transform .45s cubic-bezier(.22, 1, .36, 1);
  display: flex;
  flex-direction: column;
}

.proj-card:hover {
  background: var(--bone-3);
  transform: translateY(-4px);
  /* hard offset, no blur — a printed sheet lifted off the stack */
  box-shadow: 10px 10px 0 rgba(13, 13, 13, .07);
}

/* card copy rides above the drafting layers below */
.proj-card > *:not(.proj-fx) {
  position: relative;
  z-index: 1;
}

/* ── HOVER: the card becomes a drafting sheet under a scope ──
   Pointer position arrives as --mx/--my (px within the card) and
   --px/--py (-1…1 from centre), written by projects.js. Everything
   here is decoration, so it is gated to real pointers and degrades
   to the plain lift when the script or hover support is absent. */

/* graph paper, revealed only in the pool of light around the cursor */
.proj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(13, 13, 13, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 13, 13, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle 190px at var(--mx, 50%) var(--my, 50%),
      #000 0%, rgba(0, 0, 0, .5) 42%, transparent 76%);
  mask-image: radial-gradient(circle 190px at var(--mx, 50%) var(--my, 50%),
      #000 0%, rgba(0, 0, 0, .5) 42%, transparent 76%);
  transition: opacity .45s ease;
}

/* red rule drawing itself down the left edge and across the foot,
   closing the frame the 3px top border already started */
.proj-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(var(--red), var(--red)) left top / 2px 0 no-repeat,
    linear-gradient(var(--red), var(--red)) left bottom / 0 2px no-repeat;
  transition: background-size .55s cubic-bezier(.22, 1, .36, 1);
}

/* injected by projects.js — carries the crosshair and corner marks */
.proj-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

/* CAD crosshair, hairlines fading out away from the intersection */
.proj-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--red), var(--red)) no-repeat,
    linear-gradient(var(--red), var(--red)) no-repeat;
  background-size: 100% 1px, 1px 100%;
  background-position: 0 var(--my, 50%), var(--mx, 50%) 0;
  -webkit-mask-image: radial-gradient(circle 200px at var(--mx, 50%) var(--my, 50%),
      #000 0%, rgba(0, 0, 0, .6) 38%, transparent 74%);
  mask-image: radial-gradient(circle 200px at var(--mx, 50%) var(--my, 50%),
      #000 0%, rgba(0, 0, 0, .6) 38%, transparent 74%);
}

/* printer's registration marks snapping into the four corners */
.proj-fx::after {
  content: '';
  position: absolute;
  inset: 7px;
  background:
    linear-gradient(var(--ink), var(--ink)) left top / 9px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left top / 1px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 9px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right top / 1px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 9px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) left bottom / 1px 9px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 9px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) right bottom / 1px 9px no-repeat;
  opacity: .45;
  transform: scale(1.06);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}

/* coordinate readout trailing the crosshair, clamped inside the card */
.proj-fx-read {
  position: absolute;
  left: var(--rx, 0);
  top: var(--ry, 0);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--red-deep);
  white-space: nowrap;
}

.proj-fx-read::after {
  content: attr(data-read);
}

@media (hover: hover) and (pointer: fine) {
  .proj-card:hover::before {
    opacity: 1;
  }

  .proj-card:hover::after {
    background-size: 2px 100%, 100% 2px;
  }

  .proj-card:hover .proj-fx {
    opacity: 1;
  }

  .proj-card:hover .proj-fx::after {
    transform: none;
  }

  /* copy drifts against the cursor — parallax depth without tilting
     the card, which would fight the .r reveal transform */
  .proj-card:hover .proj-card-header {
    transform: translate(calc(var(--px, 0) * 5px), calc(var(--py, 0) * 3px));
  }

  .proj-card:hover .proj-desc {
    transform: translate(calc(var(--px, 0) * 2.5px), calc(var(--py, 0) * 1.5px));
  }

  .proj-card:hover .tech-tag {
    transform: translateY(-3px);
    border-color: var(--ink);
    color: var(--ink);
  }
}

.proj-card-header,
.proj-desc {
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.proj-card .tech-tag {
  transition: transform .35s cubic-bezier(.22, 1, .36, 1),
    border-color .35s ease, color .35s ease;
}

.proj-card .tech-tag:nth-child(1) { transition-delay: .00s; }
.proj-card .tech-tag:nth-child(2) { transition-delay: .04s; }
.proj-card .tech-tag:nth-child(3) { transition-delay: .08s; }
.proj-card .tech-tag:nth-child(4) { transition-delay: .12s; }
.proj-card .tech-tag:nth-child(5) { transition-delay: .16s; }

.proj-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.proj-name {
  position: relative;
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 900;
  font-variation-settings: 'wdth' 76;
  font-size: 18px;
  letter-spacing: -.005em;
}

/* dimension line — rule with end ticks, measured out on hover */
.proj-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 0;
  height: 5px;
  /* hidden at rest: the two end ticks alone would read as a stray
     2px mark under every card title */
  opacity: 0;
  border-left: 1px solid var(--red);
  border-right: 1px solid var(--red);
  background: linear-gradient(var(--red), var(--red)) left center / 100% 1px no-repeat;
  transition: width .55s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .proj-card:hover .proj-name::after {
    width: 100%;
    opacity: 1;
  }
}

.proj-status {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.proj-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-live {
  color: var(--ink-2);
}

.status-live::before {
  background: var(--ink);
}

.status-ongoing {
  color: var(--red-deep);
}

.status-ongoing::before {
  background: var(--red);
}

.proj-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
}

.proj-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.proj-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

.proj-date {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.btn-visit {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 9px 14px;
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-visit:hover {
  background: var(--ink);
  color: var(--bone);
}

/* ── PROGRESS BAR (for ongoing projects) ── */
.prog-bar-wrap {
  margin: 4px 0 16px;
}

.prog-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.prog-track {
  height: 4px;
  background: var(--hair);
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: var(--red);
}

.prog-fill-68 {
  width: 68%;
}

.prog-fill-42 {
  width: 42%;
}

.eta-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--hair);
  color: var(--ink-2);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .proj-grid {
    grid-template-columns: 1fr;
  }
}
