/* SoftGrid Labs — project pages and the projects list, laid out like a GitHub repository page:
   a repo header, then README-style sections in bordered boxes. Builds on base.css; motion comes from space.js. */

/* ---------- repo header ---------- */
.page-hero { position: relative; padding: 2.5rem 0 2rem; border-bottom: 1px solid var(--border-muted); background: var(--bg); overflow: hidden; isolation: isolate; }
/* a faint grid that fades out to the right, the "grid" in SoftGrid */
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--border-muted) 1px, transparent 1px), linear-gradient(90deg, var(--border-muted) 1px, transparent 1px);
  background-size: 2rem 2rem; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 50% 90% at 100% 0%, #000, transparent);
  mask-image: radial-gradient(ellipse 50% 90% at 100% 0%, #000, transparent); }
.page-hero .stage { display: grid; grid-template-columns: auto 1fr; column-gap: 1.25rem; align-items: center; }
.page-hero .stage > :not(.app-icon) { grid-column: 1 / -1; }
.page-hero .stage > .app-icon + .title { grid-column: 2; }
.app-icon { width: 4rem; height: 4rem; border-radius: var(--radius-lg); display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border); }
.app-icon img { width: 2.75rem; height: 2.75rem; }
.app-icon img.pixel { image-rendering: pixelated; }
.title { margin: 0; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.lead { margin: 1rem 0 1.5rem; max-width: 60ch; font-size: 1.0625rem; color: var(--muted); }
.lead b { color: var(--text); font-weight: 600; }
.page-hero .cta { display: flex; flex-wrap: wrap; gap: .5rem; }
.meta { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.25rem; }
.dl-note { margin: 1rem 0 0; max-width: 70ch; padding: .75rem 1rem; border-radius: var(--radius); font-size: .8125rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--rose); }
.dl-note b { color: var(--text); font-weight: 600; }

/* ---------- showcase under the header ---------- */
.showcase { margin-top: 2rem; }
.showcase .tile { cursor: default; }
.showcase .visual { border-bottom: 0; }
.showcase .tilt { aspect-ratio: auto; }
.showcase .tilt img { height: auto; }
.showcase .fan { aspect-ratio: auto; padding: 2.5rem 6% 0; }
.showcase .fan img { width: min(26%, 15rem); }

/* ---------- sections: README headings with a rule under them ---------- */
.section { padding: 4rem 0 0; }
.section-head { margin: 0 0 2rem; padding-bottom: .625rem; border-bottom: 1px solid var(--border-muted); }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.section-head p { margin: .5rem 0 0; color: var(--muted); max-width: 70ch; }

/* ---------- feature rows: text beside a framed screenshot ---------- */
.feature { display: grid; gap: 1.5rem; align-items: center; margin-bottom: 3.5rem; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1.4fr; gap: 3rem; }
  .feature.flip .text { order: 2; }
  .feature.solo { grid-template-columns: minmax(0, 46rem); }
}
.feature h3 { margin: 0 0 .25rem; font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.feature .sub { margin: 0 0 .875rem; color: var(--rose); font-size: .875rem; }
.feature p { margin: 0 0 .75rem; color: var(--muted); }
.feature ul { margin: .75rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.feature li { position: relative; padding-left: 1.5rem; color: var(--muted); font-size: .875rem; }
.feature li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.9 6.1-6.1' fill='none' stroke='%23ffb347' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1rem no-repeat; }
.feature li b { color: var(--text); font-weight: 600; }

/* a bordered, rounded frame around a screenshot */
.shot { --mx: -999px; --my: -999px; position: relative; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; background: var(--bg-inset); }
.shot img { width: 100%; }

/* phone screenshots side by side */
.phones { display: flex; justify-content: center; gap: clamp(.625rem, 2vw, 1.25rem); padding: 1.5rem 1rem; }
.phones img { width: min(31%, 13.75rem); border-radius: 1rem; border: 1px solid var(--border); }
.phones.one img { width: min(56%, 17.5rem); }
.phones img:nth-child(2) { transform: translateY(-.75rem); }

/* ---------- facts (privacy, sign-in) ---------- */
.facts { display: grid; gap: 1rem; }
@media (min-width: 900px) { .facts { grid-template-columns: 1fr 1fr; } }
.fact-card { padding: 1.25rem 1.375rem 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg); }
.fact-card h3 { margin: 0 0 .875rem; font-size: 1.25rem; font-weight: 600; }
.fact-card ul, .fact-card ol { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; color: var(--muted); font-size: .875rem; }
.fact-card b { color: var(--text); font-weight: 600; }

/* ---------- projects list ---------- */
.division { margin: 0 0 1.25rem; padding-bottom: .625rem; border-bottom: 1px solid var(--border-muted);
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 1.5rem; }
.division h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.015em; }
.division p { margin: 0; color: var(--muted); max-width: 52ch; font-size: .875rem; }
.grid-2 { display: grid; gap: 1rem; margin-bottom: 3rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 .tile.wide { grid-column: span 2; } }
.tile.wide .fan { aspect-ratio: 32 / 10; }
.tile.wide .fan img { width: 15%; }

/* ---------- entrance ---------- */
.js .page-hero .stage > * { opacity: 0; transform: translateY(.5rem); animation: rise .6s cubic-bezier(.2,.8,.2,1) forwards; }
.js .page-hero .stage > :nth-child(2) { animation-delay: .05s; }
.js .page-hero .stage > :nth-child(3) { animation-delay: .1s; }
.js .page-hero .stage > :nth-child(4) { animation-delay: .15s; }
.js .page-hero .stage > :nth-child(5) { animation-delay: .2s; }
.js .page-hero .stage > :nth-child(6) { animation-delay: .25s; }
.js .page-hero .stage > :nth-child(7) { animation-delay: .3s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .page-hero { padding: 1.75rem 0 1.5rem; }
  .section { padding-top: 3rem; }
  .feature { margin-bottom: 2.5rem; }
  .app-icon { width: 3.25rem; height: 3.25rem; }
  .app-icon img { width: 2.25rem; height: 2.25rem; }
}
.still .page-hero .stage > * { opacity: 1; transform: none; }

/* ---------- generic project page (projects/view/, text from the admin panel) ---------- */
.view-body { padding-top: 2rem; padding-bottom: 1rem; display: grid; gap: 2rem; }
.view-body .tile { max-width: 56rem; cursor: default; }
