/* =========================================================
   _contora — /portfolio section (lives below the poster
   inside index.html, not a separate page)
   ========================================================= */

:root {
  --pf-tan: #EEEAE3;          /* warm beige offset behind images */
  --pf-pad: clamp(28px, 4vw, 64px);
}


/* =========================================================
   PAGE LAYOUT — left side rail + stage
   ========================================================= */
.pf-page {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  padding: 0 var(--pf-pad) clamp(40px, 6vh, 80px);
  margin-top: -18vh; /* pulled up under the poster's /portfolio divider */
}

.pf-side {
  position: relative;
  z-index: 5;
  margin-top: 64px;
}

.pf-side {
  position: relative;
  z-index: 5;
}

.pf-title {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(26px, 2.4vw, 38px);
  letter-spacing: -.01em;
}

/* tagline — now a subtitle under /portfolio, above the previews */
.pf-tag {
  margin: clamp(18px, 3.5vh, 46px) 0 clamp(6px, 1.5vh, 16px);
  font-size: 13px;
  line-height: 1.7;
  max-width: 38ch;
  color: var(--ink);
}

.pf-filters {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.pf-filter {
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.pf-filter span { opacity: .7; margin-left: 4px; }
.pf-filter:hover { color: var(--red); transform: translateX(3px); }
.pf-filter.is-active { font-weight: 700; }

/* filters live inside the expanded /all_projects index — horizontal row */
.pf-index__filters {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  margin: 12px 0 4px;
  padding: 0 0 2px;
}

.pf-view-all {
  display: inline-block;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.pf-view-all:hover { color: var(--red); border-color: var(--red); transform: translateX(3px); }

/* full-width "view all" button BELOW the portfolio stage */
.pf-viewall-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: clamp(28px, 5vh, 64px);
}
.pf-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 30px;
  border: 1px solid var(--ink);
  background: transparent;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.pf-view-all-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--bg);
}
.pf-view-all-btn__arrow { transition: transform 0.3s var(--ease); }
.pf-view-all-btn:hover .pf-view-all-btn__arrow { transform: translateX(4px); }
/* when the index is open the arrow points up */
.pf-view-all-btn.is-open .pf-view-all-btn__arrow { transform: rotate(-90deg); }
.pf-view-all-btn.is-open:hover .pf-view-all-btn__arrow { transform: rotate(-90deg) translateX(4px); }

@media (max-width: 980px) {
  .pf-view-all-btn { width: 100%; max-width: 360px; justify-content: center; }
}


/* =========================================================
   /all_projects — expandable terminal index
   ========================================================= */
.pf-index {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;                 /* collapsed */
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  margin-top: 6px;
}
.pf-index.is-open { grid-template-rows: 1fr; }     /* revealed */
.pf-index__clip { overflow: hidden; min-height: 0; }

/* bar */
.pf-index__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 26px 0 12px;
  border-bottom: 1px solid var(--ink);
}
.pf-index__title {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 15px;
}
.pf-index__close {
  background: none;
  border: 0;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.pf-index__close:hover { color: var(--red); }
.pf-index__close:active { transform: translateY(1px); }

/* inner: list + sticky preview */
.pf-index__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 34vw, 460px);
  gap: clamp(28px, 4vw, 64px);
  padding-top: 10px;
}

/* shared row grid (header + links) */
.pf-index__head,
.pf-index__link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(130px, auto) 52px 24px;
  align-items: center;
  gap: 12px;
}
.pf-index__head {
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.45;
}
.pf-index__head span:last-child,
.pf-index__year { text-align: right; }

.pf-index__list { list-style: none; margin: 0; padding: 0; }
.pf-index__row { opacity: 0; }                       /* hidden until reveal */

.pf-index__link {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.pf-index__num   { font-variant-numeric: tabular-nums; opacity: 0.55; }
.pf-index__rt    { font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-index__rtype { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; white-space: nowrap; }
.pf-index__year  { font-variant-numeric: tabular-nums; font-size: 12px; opacity: 0.55; }
.pf-index__arrow { text-align: right; transition: transform 0.2s var(--ease); }

/* hover / keyboard focus → invert to red */
.pf-index__link:hover,
.pf-index__link:focus-visible {
  background: var(--red);
  color: var(--bg);
  outline: none;
}
.pf-index__link:hover .pf-index__num,
.pf-index__link:hover .pf-index__rtype,
.pf-index__link:hover .pf-index__year,
.pf-index__link:focus-visible .pf-index__num,
.pf-index__link:focus-visible .pf-index__rtype,
.pf-index__link:focus-visible .pf-index__year { opacity: 1; color: var(--bg); }
.pf-index__link:hover .pf-index__arrow,
.pf-index__link:focus-visible .pf-index__arrow { transform: translateX(4px); }

/* sticky preview pane */
.pf-index__preview { position: sticky; top: 24px; align-self: start; }
.pf-index__preview-frame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 120px;          /* placeholder height before a project is hovered */
  background: var(--pf-tan);
  overflow: hidden;
}
.pf-index__preview-frame img {
  /* size to the poster's natural aspect (= the video's) — no fixed ratio, no crop */
  max-width: 100%;
  max-height: 56vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  filter: blur(6px) grayscale(0.15);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease), filter 0.45s var(--ease);
}
.pf-index__preview.is-active .pf-index__preview-frame img {
  opacity: 1;
  transform: scale(1);
  filter: blur(0) grayscale(0.1) contrast(1.05);
}
.pf-index__preview-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--mono);
}
.pf-index__preview-num { font-size: clamp(34px, 3.4vw, 46px); line-height: 1; font-variant-numeric: tabular-nums; }
.pf-index__preview-title { font-weight: 600; font-size: 17px; letter-spacing: 0.01em; }
.pf-index__preview-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.6; }

/* foot */
.pf-index__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0 6px;
  margin-top: 18px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.pf-index__cats { opacity: 0.5; text-transform: uppercase; }

/* staggered row reveal (one-shot on open) */
.pf-index.is-open .pf-index__row {
  animation: pfRowIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--i) * 26ms + 0.1s);
}
@keyframes pfRowIn {
  from { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}

@media (max-width: 860px) {
  .pf-index__inner { grid-template-columns: 1fr; }
  .pf-index__preview { display: none; }
  .pf-index__link { grid-template-columns: 40px minmax(0, 1fr) 44px 20px; }
  .pf-index__rtype { display: none; }
  .pf-index__head { grid-template-columns: 40px minmax(0, 1fr) 44px 20px; }
  .pf-index__head span:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-index { transition: none; }
  .pf-index.is-open .pf-index__row { animation: none; }
  .pf-index__row { opacity: 1; }
  .pf-index__preview-frame img { transition: opacity 0.01ms; }
  .pf-view-all-btn__arrow { transition: none; }
}


/* =========================================================
   /team — portrait roster (full section below the portfolio)
   ========================================================= */
.team-roster {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  padding: clamp(48px, 9vh, 120px) var(--pf-pad) clamp(56px, 9vh, 110px);
}

.team-roster__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.team-roster__title { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.team-roster__count {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

.team-roster__grid {
  list-style: none;
  margin: 0;
  padding: clamp(28px, 4vh, 44px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 1.8vw, 30px);
}

.team-card { min-width: 0; }
.team-card__fig { margin: 0; }

.team-card__frame-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
}
/* tan offset pad — echoes the portfolio image pads */
.team-card__pad {
  position: absolute;
  left: -10px;
  bottom: -10px;
  width: 55%;
  height: 46%;
  background: var(--pf-tan);
  z-index: 0;
  transition: transform 0.5s var(--ease);
}
.team-card__frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--pf-tan);
}
.team-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.04);
  transition: filter 0.4s var(--ease), transform 0.5s var(--ease);
}
.team-card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
  pointer-events: none;
  transition: outline-color 0.3s var(--ease);
}
.team-card:hover .team-card__frame img { filter: grayscale(0) contrast(1.05); transform: scale(1.03); }
.team-card:hover .team-card__frame::after { outline-color: var(--red); }
.team-card:hover .team-card__pad { transform: translate(-4px, 4px); }

.team-card__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 16px;
}
.team-card__num {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--red);
  letter-spacing: 0.06em;
}
.team-card__name { font-weight: 600; font-size: var(--fs-name); letter-spacing: 0.01em; }
.team-card__role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-top: 2px;
}

@media (max-width: 1100px) { .team-roster__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .team-roster__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .team-roster__grid { grid-template-columns: 1fr; } }


/* =========================================================
   PREVIEW HOVER-PLAY — video over the poster image
   ========================================================= */
.pf-item__vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  background: #000;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  z-index: 1;
}
.pf-item__btn.is-playing .pf-item__vid { opacity: 1; }
/* small play hint, hidden while the clip plays */
.pf-item__btn::before {
  content: "\25B6";
  position: absolute;
  left: 8px;
  bottom: 7px;
  z-index: 3;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.pf-item__btn.is-playing::before { opacity: 0; }


/* =========================================================
   VIDEO PLAYER — playback-only overlay (brutalist, on-brand)
   ========================================================= */
.vp-overlay {
  position: fixed;
  inset: 0;
  height: 100dvh;               /* mobile: track the dynamic (visible) viewport */
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
}
.vp-overlay[hidden] { display: none; }
.vp-backdrop { position: fixed; inset: 0; height: 100dvh; background: rgba(11, 11, 11, 0.94); }
.vp-modal {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vp-bar { display: flex; align-items: baseline; gap: 14px; color: var(--bg); }
.vp-title { font-weight: 700; letter-spacing: 0.04em; font-size: 14px; }
.vp-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.55; }
.vp-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--bg);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.vp-close:hover { opacity: 1; color: var(--red); }
/* no fixed ratio — the video sizes to its own aspect within the viewport,
   so the player fits ANY ratio (square / vertical / wide) */
.vp-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #000;
}
.vp-video {
  display: block;
  max-width: 92vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}
/* native fullscreen: fill the screen, drop the inline size caps */
.vp-video:fullscreen, .vp-video:-webkit-full-screen {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}
.vp-controls { display: flex; align-items: center; gap: 14px; color: var(--bg); }
.vp-btn {
  background: none;
  border: 0;
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.vp-btn:hover { opacity: 1; color: var(--red); }
.vp-btn--play { width: 18px; text-align: left; }
.vp-vol {
  width: 64px; height: 3px; margin: 0; flex: 0 0 auto;
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px; cursor: pointer; outline: none;
}
.vp-vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); cursor: pointer;
}
.vp-vol::-moz-range-thumb {
  width: 11px; height: 11px; border: 0; border-radius: 50%;
  background: var(--bg); cursor: pointer;
}
/* iOS/touch ignore JS volume — hide the slider there (mute toggle + hardware
   buttons cover it); the slider is a desktop control. */
@media (pointer: coarse) { .vp-vol { display: none; } }
.vp-time, .vp-dur { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.8; min-width: 36px; }
.vp-dur { text-align: right; }
.vp-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  position: relative;
  touch-action: none;
}
.vp-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  bottom: -8px;
}
.vp-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--red);
}
@media (max-width: 600px) { .vp-modal { max-width: 94vw; } }


/* =========================================================
   /contact — details + project-request form
   ========================================================= */
.contact {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  padding: clamp(48px, 9vh, 120px) var(--pf-pad) clamp(64px, 11vh, 130px);
}
.contact__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.contact__title { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.contact__sub { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.5; }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 90px);
  padding-top: clamp(30px, 5vh, 52px);
}

/* details */
.contact__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 26px); }
.contact__list li { display: flex; flex-direction: column; gap: 4px; }
.contact__k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5; }
.contact__v {
  width: fit-content;
  font-size: clamp(15px, 1.4vw, 21px);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.contact__v:hover { color: var(--red); transform: translateX(3px); }

/* form */
.contact__form { display: flex; flex-direction: column; gap: 18px; }
.contact__form-lead { margin: 0 0 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.55; }
.field input,
.field textarea {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  padding: 8px 2px;
  resize: vertical;
  transition: border-color 0.15s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(0, 0, 0, 0.32); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--red); }
.contact__send {
  align-self: flex-start;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact__send:hover { background: var(--red); border-color: var(--red); color: var(--bg); }
.contact__send:active { transform: translateY(1px); }
.contact__send:disabled { opacity: 0.5; cursor: default; }
.contact__status { margin: 0; font-size: 12px; min-height: 1em; }
.contact__status.is-ok { color: var(--ink); opacity: 0.7; }
.contact__status.is-err { color: var(--red); }

@media (max-width: 760px) { .contact__grid { grid-template-columns: 1fr; gap: 40px; } }


/* =========================================================
   DEV PANEL (floating bottom-right) — temporary tweak UI
   ========================================================= */
.dev-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: 240px;
  background: #0b0b0b;
  color: #f5f4f1;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.dev-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #2a2a2a;
  background: #161616;
}

.dev-panel__title {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  opacity: 0.85;
}

.dev-panel__toggle {
  width: 22px;
  height: 22px;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.dev-panel__toggle:hover { background: #2a2a2a; }

.dev-panel__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: max-height 0.25s var(--ease), padding 0.25s var(--ease), opacity 0.2s var(--ease);
  max-height: 640px;
  overflow: hidden;
}

.dev-panel.is-collapsed .dev-panel__body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.dev-panel__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dev-panel__label {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.pf-btn:hover { background: #f5f4f1; color: #0b0b0b; }

.dev-panel .pf-btn { width: 100%; justify-content: center; }

.pf-range {
  appearance: none;
  width: 100%;
  height: 2px;
  background: #2a2a2a;
  cursor: pointer;
}
.pf-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 0;
  cursor: pointer;
}
.pf-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 0;
  cursor: pointer;
  border: 0;
}

/* ---- seed field ---- */
.pf-seed {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #2a2a2a;
  background: #161616;
  color: #f5f4f1;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.pf-seed:focus { outline: none; border-color: var(--red); }

/* ---- actions row: rebuild + save side by side ---- */
.dev-panel__actions { display: flex; gap: 6px; }
.dev-panel__actions .pf-btn { flex: 1 1 0; width: auto; }
.pf-btn.is-saved {
  background: var(--red);
  color: #f5f4f1;
  border-color: var(--red);
}

/* ---- saved builds list ---- */
.dev-panel__saved { display: flex; flex-direction: column; gap: 6px; }
.dev-panel__label--muted {
  opacity: 0.5;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pf-saved {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 132px;
  overflow-y: auto;
}
.pf-saved__empty { opacity: 0.4; font-size: 11px; padding: 2px 0; }
.pf-saved__item { display: flex; align-items: stretch; gap: 4px; }
.pf-saved__item.is-current .pf-saved__load {
  border-color: var(--red);
  color: #fff;
}
.pf-saved__item.is-current .pf-saved__load::before {
  content: "▸ ";
  color: var(--red);
}
.pf-saved__load {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.pf-saved__load:hover { background: #f5f4f1; color: #0b0b0b; }
.pf-saved__del {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid #2a2a2a;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.pf-saved__del:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- best / preview starring list ---- */
.dev-panel__best { display: flex; flex-direction: column; gap: 6px; }
.pf-best {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 160px;
  overflow-y: auto;
}
.pf-best__item { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.pf-best__star {
  flex: 0 0 auto;
  width: 16px;
  background: none;
  border: 0;
  color: #4a4a4a;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s var(--ease);
}
.pf-best__star[aria-pressed="true"] { color: var(--red); }
.pf-best__star:hover { color: #f5f4f1; }
.pf-best__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =========================================================
   STAGE — generated absolute area
   ========================================================= */
.pf-stage {
  position: relative;
  margin-top: 0;
  width: 100%;
  /* height set by JS based on layout */
}


/* ---- decoration ---- */
.pf-deco-ascii {
  position: absolute;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 7px;
  color: var(--ink);
  white-space: pre;
  overflow: hidden;
}
.pf-deco-bar {
  position: absolute;
  pointer-events: none;
}


/* ---- project item ---- */
.pf-item__pad {
  position: absolute;
  background: var(--pf-tan);
  z-index: 1;
}
.pf-item__btn {
  position: absolute;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: block;
  z-index: 2;
  transition: transform .35s var(--ease);
}
.pf-item__btn img,
.pf-item__btn .pf-art {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(.15) contrast(1.05);
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  transition: filter .3s var(--ease);
}
.pf-item__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 1px solid rgba(0,0,0,.08);
  outline-offset: -1px;
  pointer-events: none;
  transition: outline-color .25s var(--ease);
}
.pf-item__btn:hover { transform: scale(1.02); }
.pf-item__btn:hover::after { outline-color: rgba(0,0,0,.4); }
.pf-item__btn:hover img { filter: grayscale(0) contrast(1.05); }

.pf-item__label {
  position: absolute;
  z-index: 30;
  width: 130px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink);
}
.pf-item__num {
  font-size: 22px;
  margin-bottom: 16px;
  font-weight: 500;
}
.pf-item__title {
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .01em;
}
.pf-item__type {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
  opacity: .7;
}
.pf-item__arrow {
  font-size: 16px;
}

/* SVG-only "art" placeholder when an image isn't supplied */
.pf-art {
  display: block;
  width: 100%;
  height: 100%;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .pf-page { grid-template-columns: 1fr; }
  .pf-stage { margin-top: 32px; min-height: 1200px; }
}

@media (max-width: 600px) {
  .dev-panel { right: 12px; bottom: 12px; width: 200px; }
}


/* =========================================================
   EDIT MODE — admin-only UI (revealed when body.is-edit)
   ========================================================= */
.dev-panel,
.save-edit,
.pf-thumb-pick,
.pf-index__star { display: none; }
body.is-edit .dev-panel { display: block; }
body.is-edit .save-edit { display: inline-flex; }
body.is-edit .pf-thumb-pick { display: flex; }
body.is-edit .pf-index__star { display: block; }

/* dev panel sits above the save-edit button in edit mode */
.dev-panel { bottom: 72px; }
@media (max-width: 600px) { .dev-panel { bottom: 64px; } }
.dev-panel__addbtn { margin-top: 2px; }

/* save-edit (exit edit mode) */
.save-edit {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: #fff;
  border: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.save-edit:hover { background: #9e1f1d; }

/* star toggle in index rows (edit only) */
.pf-index__link { position: relative; }
.pf-index__star {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.pf-index__star.is-on { color: var(--red); }
.pf-index__star:hover { color: var(--ink); }
.pf-index__link:hover .pf-index__star,
.pf-index__link:hover .pf-index__star.is-on { color: var(--bg); }
body.is-edit .pf-index__head { padding-left: 32px; }
body.is-edit .pf-index__link { padding-left: 32px; }

/* edit-mode row actions: edit + delete */
.pf-index__row { position: relative; }
.pf-index__actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: none;
  gap: 6px;
}
body.is-edit .pf-index__actions { display: flex; }
.pf-index__act {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.pf-index__act:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pf-index__act--del:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* preview pane video (plays on hover) */
.pf-index__preview-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.pf-index__preview.is-vidplaying .pf-index__preview-vid { opacity: 1; }

/* thumbnail picker (edit only) */
.pf-thumb-pick {
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
}
.pf-thumb-pick__row { display: flex; gap: 8px; }
.pf-thumb-pick .pf-btn {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}
.pf-thumb-pick .pf-btn:hover { background: var(--red); border-color: var(--red); color: var(--bg); }
.pf-thumb-pick__status { font-size: 10px; opacity: 0.6; min-height: 1em; }

/* edit-mode login modal */
.edit-login,
.add-project {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
}
.edit-login[hidden],
.add-project[hidden] { display: none; }
.edit-login__backdrop,
.add-project__backdrop { position: absolute; inset: 0; background: rgba(11, 11, 11, 0.9); }
.edit-login__box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 90vw);
  background: #0b0b0b;
  color: #f5f4f1;
  border: 1px solid #2a2a2a;
  padding: 24px;
}
.edit-login__title { font-size: 13px; letter-spacing: 0.06em; opacity: 0.85; }
.edit-login .pf-seed { width: 100%; box-sizing: border-box; }
.edit-login__status { font-size: 11px; color: var(--red); min-height: 1em; margin: 0; }

/* add-project modal */
.add-project__box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(460px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #0b0b0b;
  color: #f5f4f1;
  border: 1px solid #2a2a2a;
  padding: 22px;
}
.add-project__bar { display: flex; justify-content: space-between; align-items: baseline; }
.add-project__title { font-weight: 700; letter-spacing: 0.04em; }
.add-project__close { background: none; border: 0; color: #8b949e; font: inherit; font-size: 12px; cursor: pointer; }
.add-project__close:hover { color: var(--red); }
.ap-field { display: flex; flex-direction: column; gap: 6px; }
.ap-field > label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.6; }
.ap-field input[type="text"],
.ap-field input[type="number"],
.ap-field textarea {
  background: #161616;
  border: 1px solid #2a2a2a;
  color: #f5f4f1;
  font: inherit;
  font-size: 13px;
  padding: 8px;
  resize: vertical;
}
.ap-field input[type="file"] { font: inherit; font-size: 11px; color: #aaa; }
.ap-tags { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 11px; }
.ap-tags label { display: inline-flex; align-items: center; gap: 5px; opacity: 0.85; cursor: pointer; }
.ap-thumb { display: flex; flex-direction: column; gap: 8px; }
.ap-thumb__preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #161616 center / cover no-repeat;
  border: 1px solid #2a2a2a;
}
.ap-thumb__row { display: flex; gap: 8px; }
.ap-thumb__row .pf-btn,
.ap-thumb__upload {
  flex: 1;
  height: 30px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ap-thumb__upload { cursor: pointer; }
.ap-add { height: 38px; margin-top: 4px; }
.ap-status { font-size: 11px; min-height: 1em; margin: 0; opacity: 0.8; }


/* =========================================================
   MOBILE PORTFOLIO — clean vertical feed (replaces the scatter)
   ========================================================= */
.pf-stage--mobile {
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(42px, 9vw, 60px);
}
.pf-stage--mobile .pf-deco-ascii,
.pf-stage--mobile .pf-deco-bar { display: none; }

.pf-mcard {
  position: relative;
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--mono);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  animation: pf-mcard-in 0.5s var(--ease) both;
}
@keyframes pf-mcard-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.pf-mcard__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pf-mcard__num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.pf-mcard__rule {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(0, 0, 0, 0.16);
}
.pf-mcard__arrow {
  font-size: 17px;
  color: var(--red);
  transition: transform 0.2s var(--ease);
}
.pf-mcard:active .pf-mcard__arrow { transform: translateX(4px); }

.pf-mcard__frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1.7778);
  background: var(--pf-tan);
  overflow: hidden;
}
.pf-mcard__frame img,
.pf-mcard__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pf-mcard__frame video {
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.pf-mcard.is-playing .pf-mcard__frame video { opacity: 1; }

.pf-mcard__meta { margin-top: 14px; }
.pf-mcard__title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pf-mcard__sub {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 5px;
}
.pf-mcard__type {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--red);
}
.pf-mcard__year {
  flex: 0 0 auto;
  font-size: 11px;
  opacity: 0.5;
}

@media (max-width: 680px) {
  /* the -18vh pull-up overlaps the poster on mobile; reset + comfy padding */
  .pf-page {
    margin-top: 0;
    padding: clamp(22px, 6vw, 34px) clamp(18px, 5vw, 26px) clamp(40px, 8vh, 70px);
  }
  .pf-tag { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-mcard { animation: none; }
}
