/* Portfolio v5 — compact homepage, internal project links, self-contained fallbacks. */

/* Open Props tokens used by earlier stylesheets. Same values as Open Props, so the
   layout still holds if the CDN stylesheet is slow, blocked, or removed later. */
:root {
  --size-8: 2rem;
  --radius-round: 1e5px;
}

/* Mode panels follow the body attribute, which header.php sets before first paint
   on the homepage. Prevents a flash of the wrong identity on load. */
body[data-site-mode="music"] .panel-portfolio,
body[data-site-mode="portfolio"] .panel-music {
  display: none;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Homepage hero: sized like the music side so the work is visible immediately ---- */
.hero-portfolio {
  min-height: 0;
  align-content: start;
  gap: 16px;
  padding: clamp(44px, 5vw, 76px) 0 clamp(36px, 4vw, 56px);
}

.hero-portfolio h1 {
  max-width: 20ch;
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 650;
}

.hero-portfolio .hero-copy {
  max-width: 62ch;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.6;
}

/* ---- "Projects" section header ---- */
.section-work {
  padding-top: clamp(36px, 4.5vw, 64px);
  padding-bottom: clamp(64px, 8vw, 108px);
}

.section-heading-compact {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: clamp(24px, 3.5vw, 44px);
  padding-bottom: clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
}

.section-heading-compact h2 {
  margin-top: 10px;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1;
  letter-spacing: -.05em;
  font-weight: 650;
}

.section-count {
  color: var(--portfolio-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
  white-space: nowrap;
}

.section-archive-link {
  display: flex;
  justify-content: flex-end;
  margin: clamp(28px, 3vw, 44px) 0 0;
  font-size: 12px;
  font-weight: 800;
}

/* ---- Project grid and cards ---- */
.project-grid {
  gap: clamp(36px, 4.5vw, 64px) clamp(20px, 2.6vw, 40px);
}

.project-card {
  gap: 18px;
}

.project-card-body {
  gap: 14px;
  align-content: start;
}

.project-card-title {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.project-card-title a {
  text-decoration: none;
}

.project-card-title a:hover,
.project-card-title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.project-card-excerpt {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--portfolio-dim);
  font-size: 14px;
  line-height: 1.6;
}

.project-media {
  display: block;
  border: 1px solid var(--line);
}

.project-media:focus-visible,
.project-link:focus-visible,
.project-card-title a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Internal link: replaces the old external "Visit project ↗". */
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 36px;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.project-link [aria-hidden="true"] {
  transition: transform 180ms var(--ease-site);
}

.project-card:hover .project-link [aria-hidden="true"],
.project-link:hover [aria-hidden="true"],
.project-link:focus-visible [aria-hidden="true"] {
  transform: translateX(4px);
}

/* ---- Project archive header ---- */
.archive-header-compact {
  padding: clamp(36px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
  gap: 14px;
}

.archive-header-compact h1 {
  font-size: clamp(38px, 5vw, 72px);
}

/* ---- Small-screen tuning ---- */
@media (max-width: 900px) {
  .hero-portfolio {
    min-height: 0;
    padding: 36px 0 32px;
  }

  .section-heading-compact {
    display: flex;
    grid-template-columns: none;
  }
}

@media (max-width: 560px) {
  .hero-portfolio h1 {
    font-size: clamp(32px, 10.5vw, 44px);
  }

  .section-heading-compact h2 {
    font-size: clamp(28px, 9vw, 38px);
  }
}

/* Skip link: hidden until focused. */
.skip-link.screen-reader-text:focus {
  position: fixed !important;
  top: 12px;
  left: 12px;
  z-index: 100001;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  background: var(--portfolio-black);
  color: var(--portfolio-paper);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

/* Page-turn backdrop: opaque, so the page being left never shows behind the turning card.
   flip.js sets the random background image inline. */
.page-flip-stage {
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
