/* Page styles for the projects, blog and demo pages. Loaded after nav.css,
   which owns the tokens and the top bar. */

body {
  background: #faf linear-gradient(160deg, #faf, #88f);
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Page: a white sheet, so no text ever sits on the gradient */
main {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
  background: var(--card);
  box-shadow: 0 2px 12px -4px rgba(17, 17, 17, 0.3);
}

@media (min-width: 700px) {
  main {
    margin: 3rem auto;
    padding: 3rem;
  }
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

main > p {
  margin: 1rem 0 3rem;
  font-size: 1.125rem;
}

main > section {
  margin-top: 3rem;
}

main > section > h2 {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Card grids */
.projects,
.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.cards.rows {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--fill);
  border: 1px solid var(--line);
}

.card:hover {
  border-color: var(--primary);
}

.card h2 {
  font-size: 1.125rem;
}

.card p {
  margin-top: 0.5rem;
  color: var(--text-soft);
}

/* Site card: the project's own share image, with a domain chip up top and its
   title along the bottom. The whole card is the link. */
.site-card {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
}

.site-card .share {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  object-position: center;
  transition: filter 0.2s ease;
}

.site-card:hover .share {
  filter: brightness(0.9);
}

/* Pills hug their content rather than spanning the artwork */
.site-card .ident,
.site-card .headline {
  position: absolute;
  left: 8px;
  right: 8px;
  display: flex;
}

.site-card .ident {
  top: 8px;
}

.site-card .headline {
  bottom: 8px;
}

.ident-pill,
.headline-pill {
  min-width: 0;
  max-width: 100%;
  border-radius: 5px;
  background: rgba(11, 17, 24, 0.5);
  backdrop-filter: blur(8px) saturate(1.2);
  color: #fff;
}

.ident-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 4px 8px 4px 4px;
  overflow: hidden;
}

.ident-pill .favicon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
}

.ident-pill .domain {
  font: normal 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* One line, ellipsised, the way X truncates a link preview's title */
.headline-pill {
  display: block;
  height: 22px;
  padding: 4px 7px;
  font-size: 13px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
