/* ============================================================
   Project pages v2. Loads AFTER css/home.css and reuses its
   tokens (--bg, --accent, --display, etc). Layout only.
   ============================================================ */

/* ---------- hero ---------- */

.p-hero {
  padding-top: clamp(7rem, 14vh, 9.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.p-hero-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.p-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1.6rem;
  transition: color 0.25s;
}

.p-hero .back-link:hover { color: var(--accent); }

.p-hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.9rem 0 1.2rem;
  text-wrap: balance;
}

.p-hero .lead {
  color: var(--text-2);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  max-width: 52ch;
}

.p-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  margin-top: 2rem;
}

.p-hero-meta div { min-width: 0; }

.p-hero-meta dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.p-hero-meta dd {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

.p-hero-figure { min-width: 0; }

.p-hero-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.p-hero-frame img { width: 100%; }

.p-hero-figure figcaption {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-3);
  max-width: 44ch;
}

/* ---------- prose sections ---------- */

.p-section {
  max-width: var(--wrap);
  margin: 0 auto;
}

.p-section h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
}

.p-section .prose {
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 68ch;
}

.p-section .prose p + p { margin-top: 1rem; }

.p-section .prose strong { color: var(--text); font-weight: 600; }

/* split: text one side, figure the other */
.p-split {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.p-split.media-left .p-split-media { order: -1; }

.p-split h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
}

.p-split .prose { color: var(--text-2); font-size: 1rem; }

.p-split .prose p + p { margin-top: 1rem; }

.p-split .prose strong { color: var(--text); font-weight: 600; }

/* figures: charts get a light paper card so they stay legible */
.figure-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.figure-frame.paper { background: #f4f5f7; padding: 0.9rem; }

/* portrait phone screenshots: cap width so they don't tower over the text */
.figure-frame.phone {
  max-width: 320px;
  margin: 0 auto;
  border-radius: 28px;
  background: #f4f5f7;
  padding: 0.6rem;
}

.figure-frame.phone img { border-radius: 20px; }

.figure-frame.phone + .p-figcaption { text-align: center; }

.figure-frame.paper img { border-radius: 8px; }

.figure-frame img { width: 100%; }

.p-figcaption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ---------- gallery ---------- */

.p-gallery {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.p-gallery figure {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 0;
}

.p-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.p-gallery figure:hover img { transform: scale(1.03); }

.p-gallery .span-2 { grid-column: span 2; }

/* ---------- tech pills ---------- */

.tech-row {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 0.42rem 1rem;
}

/* ---------- page-end nav ---------- */

.p-next {
  max-width: var(--wrap);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.p-next .back-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.25s;
}

.p-next .back-link:hover { color: var(--text); }

.p-next-card {
  text-decoration: none;
  color: inherit;
  text-align: right;
}

.p-next-card span {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.p-next-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-top: 0.3rem;
  transition: color 0.25s;
}

.p-next-card:hover h3 { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .p-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }

  .p-split { grid-template-columns: 1fr; gap: 2rem; }

  .p-split.media-left .p-split-media { order: 0; }

  .p-gallery { grid-template-columns: 1fr; }

  .p-gallery .span-2 { grid-column: span 1; }

  .p-next { flex-direction: column; align-items: flex-start; }

  .p-next-card { text-align: left; }
}
