/* ==========================================================================
   Portfolio page (portfolio.html)
   Extends css/style.css. Green #044744 extracted from pictureset.pdf.
   ========================================================================== */

:root {
  --forest: #044744; /* the pictureset green */
}

/* --------------------------------------------------------------------------
   Green hero
   -------------------------------------------------------------------------- */
.pf-hero {
  background: var(--forest);
  color: var(--sand);
  text-align: center;
  padding: clamp(150px, 21vw, 250px) var(--gut) clamp(70px, 9vw, 120px);
}

.pf-hero__eyebrow { margin-bottom: clamp(14px, 2vw, 24px); }

.pf-hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(42px, 6.6vw, 86px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow:
    0 2px 6px rgba(10, 40, 36, 0.35),
    2px 14px 40px rgba(4, 71, 68, 0.55);
}

.pf-hero__lead {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(15px, 1.66vw, 20px);
  line-height: 1.65;
  max-width: 46ch;
  margin: clamp(18px, 2.6vw, 30px) auto 0;
}

/* --------------------------------------------------------------------------
   Project sections
   -------------------------------------------------------------------------- */
.pf-project {
  padding-block: var(--section-y);
}

.pf-project + .pf-project { border-top: 1px solid rgba(98, 62, 42, 0.2); }

.pf-project__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45em clamp(12px, 1.6vw, 20px);
  margin-bottom: clamp(22px, 3vw, 38px);
}

.pf-project__index {
  font-family: var(--font-sans);
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.3em;
  color: var(--frame);
}

.pf-project__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.9vw, 48px);
  line-height: 1.05;
  color: var(--ink);
}

.pf-project__tag {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: var(--forest);
  color: var(--cream);
  padding: 0.55em 1.1em;
}

/* --------------------------------------------------------------------------
   Slideable photo rows
   -------------------------------------------------------------------------- */
.pf-row { position: relative; }

.pf-row__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: clamp(14px, 2.2vw, 26px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;                      /* Firefox */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.pf-row__track::-webkit-scrollbar { display: none; } /* Chrome / Safari */

.pf-row__track.is-dragging { cursor: grabbing; }

.pf-row__track:focus-visible {
  outline: 2px solid var(--frame);
  outline-offset: 5px;
}

.pf-shot {
  display: block;
  height: clamp(200px, 27vw, 380px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  scroll-snap-align: start;
  background: var(--beige);
  cursor: zoom-in;
}

.pf-shot img {
  display: block;
  height: 100%;
  width: auto;
  background: var(--beige);
  user-select: none;
  -webkit-user-drag: none;
  transition: filter 0.25s var(--ease);
}

.pf-shot:hover img,
.pf-shot:focus-visible img { filter: brightness(1.08); }

/* Video tiles sit in the same row as the photos */
.pf-shot--video {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.pf-shot video {
  display: block;
  height: 100%;
  width: auto;
  object-fit: cover;
  background: var(--ink);
  pointer-events: none;
}

.pf-shot__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.pf-shot__play::before {
  content: "";
  width: clamp(46px, 6vw, 64px);
  height: clamp(46px, 6vw, 64px);
  border: 1px solid rgba(244, 241, 232, 0.65);
  border-radius: 50%;
  background: rgba(6, 12, 10, 0.55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f4f1e8' d='M8 5v14l11-7z'/%3E%3C/svg%3E")
    center / 40% no-repeat;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition:
    background-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.pf-shot--video:hover .pf-shot__play::before,
.pf-shot--video:focus-visible .pf-shot__play::before {
  background-color: rgba(4, 71, 68, 0.85);
  transform: scale(1.08);
}

.pf-shot:focus-visible {
  outline: 2px solid var(--frame);
  outline-offset: 3px;
}

.pf-shot:active { outline: none; }

/* Full-page preview (lightbox) */
body.pf-viewer-open { overflow: hidden; }

.pf-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gut);
}

.pf-viewer[hidden] { display: none; }

.pf-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 10, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: pf-fade 0.3s var(--ease) both;
}

.pf-viewer__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  text-align: center;
}

.pf-viewer__media img,
.pf-viewer__media video {
  display: block;
  max-width: 86vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: clamp(8px, 1.4vw, 16px);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 10px 34px rgba(0, 0, 0, 0.45);
  animation: pf-lift 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pf-viewer__caption {
  font-family: var(--font-sans);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(244, 241, 232, 0.85);
  margin: 0;
}

.pf-viewer__close,
.pf-viewer__arrow {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(42px, 5vw, 54px);
  height: clamp(42px, 5vw, 54px);
  border: 1px solid rgba(244, 241, 232, 0.35);
  border-radius: 50%;
  background: rgba(244, 241, 232, 0.08);
  color: var(--offwhite);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.pf-viewer__close:hover,
.pf-viewer__arrow:hover:not(:disabled) {
  background: var(--sand);
  color: var(--ink);
  border-color: var(--sand);
}

.pf-viewer__close:disabled,
.pf-viewer__arrow:disabled { opacity: 0.3; cursor: default; }

.pf-viewer__close {
  font-size: clamp(26px, 3vw, 36px);
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
}

.pf-viewer__arrow {
  font-size: clamp(26px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
}
.pf-viewer__arrow--prev { left: max(14px, env(safe-area-inset-left)); }
.pf-viewer__arrow--next { right: max(14px, env(safe-area-inset-right)); }

@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes pf-lift {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Scroll arrows */
.pf-row__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(42px, 5vw, 54px);
  height: clamp(42px, 5vw, 54px);
  border: 1px solid var(--frame);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.pf-row__btn:hover:not(:disabled) {
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}

.pf-row__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pf-row__btn--prev { left: clamp(-20px, -1.8vw, -4px); }
.pf-row__btn--next { right: clamp(-20px, -1.8vw, -4px); }

.pf-row__arrow {
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.pf-row__btn--prev .pf-row__arrow { transform: rotate(135deg); }  /* points left */
.pf-row__btn--next .pf-row__arrow { transform: rotate(-45deg); }  /* points right */

/* --------------------------------------------------------------------------
   Scroll-in reveal — ".pf-reveal" is added by JS, so no-JS stays visible
   -------------------------------------------------------------------------- */
.pf-reveal .pf-shot {
  opacity: 0;
  transform: translateY(-28px);
}

.pf-reveal .pf-shot.is-in {
  animation: pf-drop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;   /* fast drop, no bop */
}

@keyframes pf-drop {
  from { opacity: 0; transform: translateY(-28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pf-reveal .pf-project__head {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.pf-reveal .pf-project.is-in .pf-project__head {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Footer keeps the forest green (style.css uses the lighter --green)
   -------------------------------------------------------------------------- */
.site-footer { background: var(--forest); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .pf-hero { padding-top: clamp(120px, 20vw, 175px); }

  .pf-shot { height: clamp(170px, 30vw, 260px); }

  .pf-row__btn { width: 40px; height: 40px; }
  .pf-row__btn--prev { left: -8px; }
  .pf-row__btn--next { right: -8px; }
}

@media (max-width: 620px) {
  .pf-shot { height: clamp(150px, 40vw, 210px); }

  .pf-project__head { gap: 0.3em 0.8em; }
  .pf-project__title { font-size: clamp(24px, 8vw, 34px); }
}

@media (prefers-reduced-motion: reduce) {
  .pf-reveal .pf-shot { opacity: 1; transform: none; }
  .pf-reveal .pf-shot.is-in { animation: none; }
  .pf-reveal .pf-project__head { opacity: 1; transform: none; transition: none; }
  .pf-viewer__backdrop { animation: none; }
  .pf-viewer__media img,
  .pf-viewer__media video { animation: none; }
}