/* ============================================================
   Project detail page styles — shared between standalone pages
   at /projects/<slug>/ and the in-page panel on the homepage.
   The homepage injects fetched project content into a panel and
   relies on these styles being already loaded.

   IMPORTANT: every selector here targets markup that appears
   INSIDE the project content (.card-page and its descendants),
   never the homepage layout. No risk of leaking onto the chat UI.
   ============================================================ */

/* The page-container — sets max-width and side padding. */
main.page {
  position: relative;
  z-index: 50;
  max-width: 760px;
  margin: 0 auto;
  padding: 84px 16px 64px;
}

/* Custom scrollbar for standalone project pages. The in-panel
   surface gets its own scoped rule in index.html. Thin white track
   matching the chat conversation aesthetic. */
html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
html::-webkit-scrollbar { width: 4px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
html::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }

/* The floating glass card that holds the whole project. Same
   recipe as the homepage chat card. */
.card-page {
  background:
    linear-gradient(180deg, rgba(15,18,32,0.30) 0%, rgba(15,18,32,0.45) 100%),
    rgba(255,255,255,0.06);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.20);
  padding: 52px 56px 56px;
  color: var(--ink-soft);
}

/* Project header — logo (optional) → title → italic tagline. */
.project-header { margin-bottom: 32px; }
/* Project avatar — square with rounded corners, left-aligned, above
   the title. Same on desktop and mobile.
   Default: edge-to-edge image, transparent backdrop (for logos that
   are their own app-icon — opaque, self-framed).
   Opt-in via .is-tiled when the logo is a transparent vector mark
   that needs a colored backdrop to read. */
.project-banner {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 24px;
}
.project-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: cover;
  display: block;
}
.project-banner.is-tiled {
  background: color-mix(in srgb, var(--panel-brand, #2a2f44) 30%, #0d1020);
}
.project-banner.is-tiled img {
  padding: 10px;
  object-fit: contain;
}
main[data-theme="voteable"] .project-banner.is-tiled img { filter: brightness(0) invert(1); }
.project-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.project-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 23px;
  line-height: 1.38;
  color: var(--ink-mute);
  max-width: 580px;
}

/* Meta pills — quick-scan facts + outbound links. */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 52px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.09);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  pointer-events: auto;
}
.pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  pointer-events: none;
}
.pill.link {
  background: rgba(255,255,255,0.14);
  color: var(--ink-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255,255,255,0.10);
  transition: background 180ms ease, color 180ms ease;
}
.pill.link:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.pill.link:focus-visible {
  outline: 2px solid rgba(255,255,255,0.55);
  outline-offset: 2px;
}
.pill.link:active { background: rgba(255,255,255,0.28); }
.pill.link .ext {
  opacity: 0.7;
  margin-left: -2px;
  transition: transform 180ms ease;
}
.pill.link:hover .ext { transform: translate(2px, -2px); }

/* Body sections — long-form prose with editorial cadence. */
.section {
  padding-top: 36px;
  margin-bottom: 8px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.section:first-of-type { border-top: none; padding-top: 0; }
.section h2 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.section p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.section p:last-child { margin-bottom: 0; }
.section a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
  text-underline-offset: 3px;
}
.section a:hover { text-decoration-color: rgba(255,255,255,0.9); }
.section strong { font-weight: 600; }
.section ul { list-style: none; padding: 0; margin: 0; }
.section ul li {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.section ul li:last-child { border-bottom: none; }
.section ul li::before {
  content: "•";
  position: absolute;
  left: 3px;
  top: 9px;
  font-size: 15px;
  color: var(--ink-mute);
}
.section ul li strong {
  color: var(--ink-soft);
  font-weight: 600;
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 4px;
}

/* Stack section — technology tags. */
.stack-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.stack-tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255,255,255,0.09);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* Pull-quote — editorial moment. */
.pull-quote {
  margin: 28px 0 28px;
  padding: 4px 0 4px 22px;
  border-left: 2px solid rgba(255,255,255,0.45);
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Screenshot gallery — one hero + three smaller. */
.screenshots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.screenshots figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 200ms, transform 200ms;
}
.screenshots figure:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}
.screenshots figure.featured { grid-column: 1 / -1; }
/* Hero-shot variant — promoted visual right after the meta-row.
   Sits before the first section, so no top border; adds bottom space
   so the section below has clean breathing room. */
.screenshots.hero-shot { margin-bottom: 36px; grid-template-columns: 1fr; }
.screenshots img { width: 100%; height: auto; display: block; }
.screenshots figcaption {
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.screenshot-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.screenshots figure.featured .screenshot-placeholder { aspect-ratio: 21 / 9; }

/* Closing italic line. */
.closing {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid rgba(255,255,255,0.10);
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-mute);
}
.closing a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.32);
  transition: border-color 200ms;
}
.closing a:hover { border-bottom-color: rgba(255,255,255,0.9); }

/* ============================================================
   Stub-project variant — used by Manifest, CampaignAI, Squad,
   Voteable while their full case studies are in progress. Same
   .card-page wrapper, but tighter content.
   ============================================================ */
.stub-note {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
  padding: 16px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin: 32px 0 24px;
}
.stub-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(15,15,20,0.85);
  color: #fff;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 180ms;
}
.stub-cta:hover { background: rgba(15,15,20,1); }

/* ============================================================
   Mobile overrides — both standalone pages AND in-panel
   rendering (panel goes fullscreen on mobile, see project-panel.css)
   ============================================================ */
@media (max-width: 640px) {
  main.page { padding: 0; max-width: none; }
  .card-page {
    padding: 36px 22px 48px;
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
    /* Match desktop scrim — heavier mobile scrim was making the
       content read too dark vs the rest of the site. */
    background:
      linear-gradient(180deg, rgba(15,18,32,0.30) 0%, rgba(15,18,32,0.45) 100%),
      rgba(255,255,255,0.06);
  }
  .project-banner {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    margin-bottom: 20px;
  }
  .project-banner.is-tiled img { padding: 8px; }
  .project-title { font-size: 44px; letter-spacing: -0.02em; }
  .project-tagline { font-size: 18px; }
  .meta-row { margin-bottom: 40px; padding-bottom: 24px; gap: 6px; }
  .pill { padding: 6px 12px; font-size: 12.5px; }
  .stack-tag { padding: 4px 11px; font-size: 12px; }
  .section { padding-top: 28px; }
  .section h2 { font-size: 14px; margin-bottom: 14px; }
  .section p, .section ul li { font-size: 16px; }
  .pull-quote { font-size: 22px; padding-left: 16px; margin: 22px 0; }
  .closing { font-size: 17px; padding-top: 28px; margin-top: 44px; }
  .screenshots { grid-template-columns: 1fr; }
  .screenshots figure.featured .screenshot-placeholder { aspect-ratio: 16 / 9; }
}
