/*===== PROJECTS =====
  The full-width project windows on the home page and the project pages:
  screenshots on the left, clickable keywords and the description on the
  right. Uses terminal.css. */

.pj-list {
  display: grid;
  gap: 28px;
}

.pj-card .t-win__bar {
  height: 34px;
}

.pj-card .t-win__title {
  font-size: 13px;
  line-height: 18px;
}

.pj-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

/*===== SCREENSHOTS =====*/
.pj-shots {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 20px);
  padding: clamp(28px, 3.4vw, 48px) clamp(14px, 2.4vw, 36px);
  border-right: 2px solid var(--ink);
  background-image: radial-gradient(var(--rule) 1px, transparent 1.3px);
  background-size: 18px 18px;
}

/*===== IPHONE FRAME =====
  The bezel, island and buttons stay dark like real hardware; the ink outline
  and shadow keep the phone visible in both inks. */
/* the phone is a size container so the bezel (3.5cqi) scales with the phone itself */
.phone {
  position: relative;
  display: block;
  flex: none;
  container-type: inline-size;
  border: 1.5px solid var(--ink);
  border-radius: 13% / 6%;
  background-color: #111113;
  box-shadow: 3px 3px 0 var(--ink);
}

.phone img {
  width: calc(100% - 7cqi);
  margin: 3.5cqi;
  aspect-ratio: 1280 / 2781;
  height: auto;
  object-fit: cover;
  border-radius: 10% / 4.6%;
  background-color: #FFFFFF;
}

.phone__island {
  position: absolute;
  z-index: 1;
  top: 2.8%;
  left: 50%;
  width: 30%;
  height: 4.2%;
  border-radius: 999px;
  background-color: #111113;
  transform: translateX(-50%);
}

/* volume buttons on the left, side button on the right */
.phone::before,
.phone::after {
  content: '';
  position: absolute;
  width: 3px;
  background-color: var(--ink);
}

.phone::before {
  left: -4.5px;
  top: 19%;
  height: 15%;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(var(--ink) 0 42%, transparent 42% 58%, var(--ink) 58%);
}

.phone::after {
  right: -4.5px;
  top: 24%;
  height: 11%;
  border-radius: 0 2px 2px 0;
}

.pj-shots .phone {
  width: min(31%, 210px);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

.pj-shots .phone:nth-child(2) {
  transform: translateY(-14px);
}

a.pj-shots:hover .phone {
  transform: translateY(-6px);
}

a.pj-shots:hover .phone:nth-child(2) {
  transform: translateY(-20px);
}

a.pj-shots:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -6px;
}

/* one phone beside a long write-up: start at the top and stay in view while reading */
.pj-shots--single {
  align-items: flex-start;
}

.pj-shots--single .phone {
  position: sticky;
  top: calc(var(--hx-header-h) + 32px);
  width: min(52%, 250px);
}

.pj-shots__hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 2px 6px;
  background-color: var(--paper);
  font: 500 11px var(--mono);
  color: var(--dim);
}

a.pj-shots:hover .pj-shots__hint {
  color: var(--ink);
}

/*===== KEYWORDS + DESCRIPTION =====*/
.pj-info {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: clamp(20px, 3vw, 40px);
}

.pj-kws {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pj-kw {
  appearance: none;
  padding: 7px 11px;
  border: 1px solid var(--ink);
  background-color: var(--paper);
  font: 500 12.5px/1.2 var(--mono);
  cursor: pointer;
}

.pj-kw[aria-pressed="true"] {
  background-color: var(--ink);
  background-image: none;
  color: var(--paper);
}

.pj-kw:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.pj-summary {
  max-width: 70ch;
  font: 400 14.5px/1.8 var(--mono);
  color: var(--text);
}

.pj-points {
  display: grid;
  gap: 12px;
}

.pj-point {
  position: relative;
  padding-left: 22px;
  font: 400 14.5px/1.75 var(--mono);
  color: var(--text);
  transition: opacity .25s ease;
}

.pj-point::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--dim);
}

.pj-point mark {
  padding: 0 2px;
  background: none;
  color: var(--ink);
  font-weight: 700;
}

/* a pressed keyword lights up where it appears and dims the other lines */
.pj-point mark.is-on {
  background-color: var(--ink);
  color: var(--paper);
}

.has-kw .pj-point:not(.is-match) {
  opacity: .35;
}

.pj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media screen and (max-width: 900px) {
  .pj-card__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .pj-shots {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }
}

/*===== PROJECT PAGE =====*/
.pd {
  padding-top: var(--hx-header-h);
}

.pd-back {
  display: inline-block;
  margin-bottom: 22px;
  font: 500 13px var(--mono);
  color: var(--dim);
}

.pd-back:hover {
  color: var(--ink);
}

.pd-back:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.pd-meta {
  margin-top: 14px;
  font: 500 14px/1.5 var(--mono);
  color: var(--dim);
}

.pd-walk {
  display: grid;
  gap: 32px;
}

.pd-feature__body {
  display: grid;
  grid-template-columns: minmax(160px, 250px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(20px, 3vw, 40px);
}

.pd-feature__shot {
  width: 100%;
}

.pd-feature__text h3 {
  margin-bottom: 16px;
  font: 800 clamp(20px, 2.4vw, 26px)/1.15 var(--mono);
  letter-spacing: -.02em;
}

.pd-feature__text p {
  margin-bottom: 1.1em;
  max-width: 68ch;
  font: 400 14.5px/1.8 var(--mono);
  color: var(--text);
}

.pd-feature__text p:last-child {
  margin-bottom: 0;
}

@media screen and (max-width: 720px) {
  .pd-feature__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .pd-feature__shot {
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pj-shots .phone,
  .pj-point {
    transition: none;
  }
}
