.e8-portfolio {
  --e8-paper: #f5f0e7;
  --e8-ink: #211d18;
  --e8-soft: #62574a;
  --e8-gold: #91642a;
  --e8-line: #d7ccbb;
  margin: clamp(32px, 6vw, 88px) auto;
  padding: clamp(22px, 4vw, 58px);
  background: var(--e8-paper);
  color: var(--e8-ink);
  border-radius: 12px;
}
.e8-portfolio-intro { max-width: 720px; margin-bottom: clamp(20px, 3vw, 38px); }
.e8-portfolio-label, .e8-project-label { color: var(--e8-gold); font-size: .75rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.e8-portfolio .e8-portfolio-intro h2 {
  margin: 8px 0 10px;
  color: var(--e8-ink);
  font: normal clamp(2.1rem, 5vw, 4.2rem)/1.04 Georgia, serif;
  letter-spacing: -.035em;
}
.e8-portfolio .e8-portfolio-intro p,
.e8-portfolio .e8-story p { margin: 0; color: var(--e8-soft); line-height: 1.65; }
.e8-project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(14px, 2.3vw, 30px); align-items: start; }
.e8-project { min-width: 0; border-top: 1px solid var(--e8-line); }
.e8-project[open] { grid-column: 1 / -1; }
.e8-project-summary {
  display: grid; grid-template-rows: auto auto minmax(2.4em, auto) auto; align-content: start; gap: 7px;
  padding-top: 12px; cursor: pointer; list-style: none;
}
.e8-project-summary::-webkit-details-marker { display: none; }
.e8-project-summary::marker { content: ''; }
.e8-project-summary:focus-visible, .e8-portfolio a:focus-visible { outline: 2px solid #6f4a1b; outline-offset: 4px; }
.e8-cover { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #e0d6c6; }
.e8-cover img, .e8-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.e8-cover img { transition: transform .24s ease; }
@media (hover: hover) { .e8-project-summary:hover .e8-cover img { transform: scale(1.035); } }
.e8-project[open] .e8-project-summary { grid-template-rows: auto; }
.e8-project[open] .e8-cover { aspect-ratio: 16 / 7; }
.e8-project-label { margin-top: 7px; }
.e8-project-title { font: normal clamp(1.35rem, 2vw, 1.95rem)/1.13 Georgia, serif; }
.e8-project-control { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 9px 0; border-bottom: 1px solid var(--e8-line); color: var(--e8-ink); font-size: .875rem; font-weight: 700; }
.e8-image-count { color: var(--e8-soft); font-weight: 400; }
.e8-when-open, .e8-project[open] .e8-when-closed { display: none; }
.e8-project[open] .e8-when-open { display: inline; }
.e8-story { padding: clamp(20px, 3vw, 36px) 0 12px; }
.e8-story-copy { display: grid; gap: 10px; max-width: 650px; margin-bottom: 20px; }
.e8-portfolio .e8-story h3 { margin: 0; color: var(--e8-ink); font: normal 1.6rem/1.2 Georgia, serif; }
.e8-story-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 5px; }
.e8-portfolio .e8-story-actions a { color: var(--e8-ink); text-underline-offset: 4px; }
.e8-portfolio .e8-story-actions .e8-project-cta { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 15px; border-radius: 4px; background: #35281e; color: #fffaf1; text-decoration: none; }
.e8-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.e8-gallery .rp-photo { display: block; width: 100%; aspect-ratio: 1; min-height: 0; overflow: hidden; border: 0; border-radius: 3px; }
.e8-gallery .rp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 600px) {
  .e8-project-summary, .e8-project[open] .e8-project-summary { grid-template-rows: auto; }
  .e8-project[open] .e8-cover { aspect-ratio: 4 / 3; }
  .e8-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .e8-cover img { transition: none; } }
