/* ============================================================
   Built and shipped, and the portfolio category tiles.

   The card design is the one the owner kept from the previous
   build: the screenshot framed in browser chrome with the real
   domain in the title bar, graded into the page so different
   brands read as one composition.
   ============================================================ */

.wall {
  display: grid; gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 860px) { .wall { grid-template-columns: 1fr; } }

.build { overflow: hidden; display: flex; flex-direction: column; }

/* A screenshot bleeding to the card edge reads as a bright rectangle of
   somebody else's brand. Framed in browser chrome with the real domain it
   reads as evidence, and the domain doubles as the thing you can go check. */
.build__frame {
  margin: 14px 14px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--well);
  box-shadow: var(--sh-frame);
}
.chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}
.chrome i { width: 8px; height: 8px; border-radius: 50%; background: var(--chrome-dot); flex: 0 0 auto; }
.chrome span {
  margin-left: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.build__shot { position: relative; overflow: hidden; background: var(--bg-2); }
.build__shot img {
  width: 100%; aspect-ratio: 16/10;
  object-fit: cover; object-position: top center;
  filter: var(--shot-filter);
  transition: transform var(--t-slow) var(--ease), filter var(--t-med) var(--ease);
}
.build:hover .build__shot img { transform: scale(1.028); filter: none; }

/* The violet wash ties a foreign palette to the page light. It lifts on
   hover, because someone looking closely deserves the real colours. */
.build__shot::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--wash);
  mix-blend-mode: color;
  opacity: .85;
  transition: opacity var(--t-med) var(--ease);
}
.build:hover .build__shot::before { opacity: .28; }

.build__shot::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--scrim);
}

/* No screenshot yet: a clean type panel instead of a broken frame. */
.build__type {
  aspect-ratio: 16/10;
  display: grid; place-items: center; text-align: center;
  padding: 20px;
  background:
    radial-gradient(80% 70% at 50% 20%, color-mix(in srgb, var(--purple) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
}
.build__type span {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-2);
}

.build__body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.build__tag { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.build__body h3 { margin: 0; }
.build__body p { color: var(--muted); font-size: var(--step--1); margin: 0; }
.build__did { color: var(--text) !important; }
.build__stack { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.build__foot {
  margin-top: auto; padding-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.seeit { font-size: var(--step-0); font-weight: 700; color: var(--purple); }
.seeit:hover { color: var(--pink); }
.private { font-size: 12px; color: var(--muted-2); }

/* ============================================================
   Portfolio category tiles. Image with the category name over it,
   description underneath.
   ============================================================ */

.catgrid {
  display: grid;
  gap: 30px 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) { .catgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .catgrid { grid-template-columns: 1fr; } }

.cat__card {
  display: block; position: relative;
  border-radius: var(--r-tile);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-2);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.cat__card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--sh-lift);
}

.cat__media { display: block; position: relative; }
.cat__media img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover; object-position: top center;
  filter: var(--shot-filter);
  transition: transform var(--t-slow) var(--ease);
}
.cat__card:hover .cat__media img { transform: scale(1.04); }

/* Darkened enough that the label holds over a bright screenshot, which is
   the hard case. Weighted toward the middle, where the label sits. */
.cat__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(70% 55% at 50% 50%, rgba(11, 7, 19, .58), transparent 75%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 42%, transparent) 0%,
      color-mix(in srgb, var(--bg) 74%, transparent) 100%),
    var(--wash);
}

/* Categories with no screenshot: a quiet grid pattern, no stock photo. */
.cat__pattern {
  display: block; width: 100%; aspect-ratio: 4/3;
  background:
    radial-gradient(70% 60% at 50% 25%, color-mix(in srgb, var(--purple) 20%, transparent), transparent 72%),
    repeating-linear-gradient(0deg, var(--border) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
}

.cat__name {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 18px; text-align: center;
  font-size: var(--step-2); font-weight: 800; letter-spacing: -.015em;
  line-height: 1.15;
  color: #FFFFFF;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .7);
  text-wrap: balance;
}

.cat__blurb { margin-top: 12px; color: var(--muted); font-size: var(--step--1); }

/* A screenshot that is already dark: no grade, no wash, no scrim, or it
   disappears into the card. */
.build--bright .build__shot img { filter: none; }
.build--bright .build__shot::before,
.build--bright .build__shot::after { display: none; }

/* Back link at the top of a portfolio category page */
.backlink { display: inline-block; margin-bottom: 18px; font-weight: 700; font-size: var(--step-0); color: var(--cyan); }
.backlink:hover { color: var(--pink); }

/* Bigger category tiles on the home page. Square pictures on a wider row,
   sized so the heading, all three tiles and their text fit on one screen. */
#portfolio .wrap { max-width: 1320px; }
#portfolio .catgrid { gap: 30px 26px; }
/* Height follows the screen, not the width, so on a short or zoomed
   laptop screen the tiles and their text still fit without scrolling. */
#portfolio .cat__media img,
#portfolio .cat__pattern { aspect-ratio: auto; height: clamp(170px, calc(100svh - 430px), 396px); }
/* Less empty space above the heading, so more of the screen goes to the tiles. */
#portfolio.sec { padding-top: clamp(32px, 4vw, 48px); }
#portfolio .cat__name { font-size: var(--step-3); padding: 22px; }
#portfolio .cat__blurb { font-size: var(--step-0); margin-top: 14px; }
/* Three tiles, so keep them in one row down to tablet width instead of
   leaving one tile alone on a second row. */
@media (min-width: 561px) and (max-width: 900px) {
  #portfolio .catgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
  #portfolio .cat__name { font-size: var(--step-1); padding: 12px; }
  #portfolio .cat__media img,
  #portfolio .cat__pattern { height: clamp(150px, 40vw, 340px); }
  #portfolio .cat__blurb { font-size: var(--step--1); }
}
