/* Portfolio page — hero with video + stacked project rows */

#main-content.portfolio-page {
  margin-block-end: 3rem;
}

.portfolio-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.portfolio-page__article {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

/* Hero block — fills one viewport minus the site header. H1+lead at
   the top, video centered, scroll cue absolutely pinned near the bottom.
   The 4rem subtract accounts for main's top margin (common.css:150) so
   the block ends exactly at the viewport edge instead of overflowing. */
.portfolio-page__hero-block {
  position: relative;
  min-height: calc(100vh - var(--header-height, 120px) - 4rem);
  min-height: calc(100dvh - var(--header-height, 120px) - 4rem);
  display: grid;
  grid-template-rows: auto 1fr;
  padding-block: 1.5rem 4.5rem;
}

/* Hero */
.portfolio-page__hero {
  text-align: center;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.portfolio-page__hero h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--secondary-color);
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.portfolio-page__lead {
  width: 100%;
  max-width: none;
  margin: 0.75rem 0 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--secondary-color);
  opacity: 0.78;
  text-align: center;
  text-wrap: balance;
}

/* Cover / video — sits in the middle grid row, centered. */
.portfolio-page__cover {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.portfolio-page__cover-inner {
  position: relative;
  width: 100%;
  max-width: 46rem;
  aspect-ratio: 16 / 9;
  max-height: min(calc(100vh - var(--header-height, 120px) - 18rem), 28rem);
  max-height: min(calc(100dvh - var(--header-height, 120px) - 18rem), 28rem);
  min-height: 10.5rem;
  overflow: hidden;
  border-radius: 0.4rem;
  border: 1px solid rgba(232, 232, 233, 0.06);
  background-color: #000;
}

.portfolio-page__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Scroll cue — sits at the bottom of the hero block and bounces */
.portfolio-page__scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--secondary-color);
  opacity: 0.7;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.portfolio-page__scroll-cue:hover,
.portfolio-page__scroll-cue:focus-visible {
  opacity: 1;
  color: var(--primary-color);
  outline: none;
}

.portfolio-page__scroll-cue-arrow {
  display: inline-flex;
  animation: portfolio-scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes portfolio-scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(0.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-page__scroll-cue-arrow {
    animation: none;
  }
}

/* Project list */
.portfolio-page__projects {
  width: 100%;
  max-width: 64rem;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.portfolio-page__project {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(232, 232, 233, 0.08);
}

.portfolio-page__project:first-child {
  border-top: none;
  padding-top: 0;
}

.portfolio-page__project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: rgba(33, 39, 47, 0.6);
  border: 2px dashed rgba(16, 172, 132, 0.35);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-page__project-placeholder {
  color: rgba(16, 172, 132, 0.55);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-page__project-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portfolio-page__project-title {
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--secondary-color);
  margin: 0;
}

.portfolio-page__project-blurb {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--secondary-color);
  opacity: 0.85;
  margin: 0;
  max-width: 44rem;
}

.portfolio-page__project-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.portfolio-page__project-link:hover,
.portfolio-page__project-link:focus {
  background: var(--primary-color);
  color: var(--secondary-color);
  outline: none;
}

@media (max-width: 720px) {
  .portfolio-page__project {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portfolio-page__projects {
    gap: 1.75rem;
  }

  .portfolio-page__project-media {
    max-width: 420px;
  }
}

@media (hover: none) {
  .portfolio-page__project-link:hover {
    background: transparent;
    color: var(--primary-color);
  }
}
