/* ═══════════════════════════════════════════════════════════════════
   NEXUS AI — Project folders (tabs + shared entry template)
   Loaded after bridge.css; only styles .pf-* and the projects panel size.
   ═══════════════════════════════════════════════════════════════════ */

/* Panel: a fixed-height folder so the nav and entry scroll independently */
.hud-projects {
  width: min(1240px, calc(100vw - 1.2rem));
}

.hud-projects .hud-chrome--projects {
  height: calc(100vh - 6.5rem - var(--helm-clearance, 8.75rem) + 1.2rem);
  min-height: 22rem;
}

.pf {
  --pf-accent: var(--cyan, #3de0ff);
  --pf-accent-soft: rgba(61, 224, 255, 0.16);
  --pf-accent-line: rgba(61, 224, 255, 0.4);
  --pf-sheet-bg: rgba(6, 20, 44, 0.62);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.8rem 0.8rem;
}

.pf-accent--cyan { --pf-accent: #3de0ff; --pf-accent-soft: rgba(61, 224, 255, 0.16); --pf-accent-line: rgba(61, 224, 255, 0.42); }
.pf-accent--amber { --pf-accent: #ffba40; --pf-accent-soft: rgba(255, 186, 64, 0.14); --pf-accent-line: rgba(255, 186, 64, 0.42); }
.pf-accent--green { --pf-accent: #3dff9a; --pf-accent-soft: rgba(61, 255, 154, 0.13); --pf-accent-line: rgba(61, 255, 154, 0.38); }
.pf-accent--violet { --pf-accent: #b58cff; --pf-accent-soft: rgba(181, 140, 255, 0.15); --pf-accent-line: rgba(181, 140, 255, 0.42); }
.pf-accent--red { --pf-accent: #ff4d6d; --pf-accent-soft: rgba(255, 77, 109, 0.14); --pf-accent-line: rgba(255, 77, 109, 0.42); }

/* ── Folder tabs ── */
.pf-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  padding: 0 0.5rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.pf-tabs::-webkit-scrollbar { display: none; }

.pf-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.15rem;
  padding: 0.5rem 1.15rem 0.45rem 0.85rem;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
  background: rgba(4, 14, 32, 0.55);
  border: 1px solid rgba(61, 224, 255, 0.18);
  border-bottom-color: transparent;
  border-radius: 10px 16px 0 0;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.pf-tab:hover,
.pf-tab:focus-visible {
  color: var(--text);
  outline: none;
  border-color: var(--pf-accent-line);
  border-bottom-color: transparent;
}

.pf-tab-pip {
  width: 0.95rem;
  height: 0.36rem;
  border-radius: 0.3rem 0.08rem 0.08rem 0.3rem;
  background: var(--pf-accent);
  opacity: 0.45;
  transition: opacity 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.pf-tab.is-active {
  z-index: 1;
  color: var(--text);
  background: var(--pf-sheet-bg);
  border-color: var(--pf-accent-line);
  border-bottom-color: transparent;
  box-shadow: 0 -6px 16px -10px var(--pf-accent);
}

.pf-tab.is-active::after {
  /* merges the active tab into the folder sheet */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(6, 20, 44, 0.98);
}

.pf-tab.is-active .pf-tab-pip {
  opacity: 1;
  box-shadow: 0 0 8px var(--pf-accent);
}

/* ── Folder sheet ── */
.pf-sheet {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(10.5rem, 13.5rem) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.7rem;
  background: var(--pf-sheet-bg);
  border: 1px solid var(--pf-accent-line);
  border-radius: 4px 12px 12px 12px;
}

/* ── Left nav ── */
.pf-nav {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(61, 224, 255, 0.1);
  padding-right: 0.55rem;
}

.pf-nav-head {
  font-family: var(--font-display);
  font-size: 0.44rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.2rem 0.45rem;
}

.pf-nav-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 0.22rem;
  padding-right: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: var(--pf-accent-line) transparent;
}

.pf-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  padding: 0.42rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--text-muted);
  background: rgba(4, 14, 32, 0.4);
  border: 1px solid rgba(61, 224, 255, 0.1);
  border-left: 3px solid transparent;
  border-radius: 2px 8px 8px 2px;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.pf-nav-item:hover,
.pf-nav-item:focus-visible {
  color: var(--text);
  outline: none;
  border-color: var(--pf-accent-line);
  border-left-color: var(--pf-accent-line);
}

.pf-nav-item.is-active {
  color: var(--text);
  background: var(--pf-accent-soft);
  border-color: var(--pf-accent-line);
  border-left-color: var(--pf-accent);
}

.pf-nav-idx {
  font-family: var(--font-display);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  color: var(--pf-accent);
  opacity: 0.75;
  flex-shrink: 0;
}

/* ── Entry ── */
.pf-entry {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--pf-accent-line) transparent;
}

.pf-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.pf-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--text);
}

.pf-tagline {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.pf-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.pf-badge,
.pf-link {
  font-family: var(--font-display);
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--pf-accent-line);
  color: var(--pf-accent);
  background: var(--pf-accent-soft);
  white-space: nowrap;
}

.pf-badge--folder {
  color: var(--text-dim);
  background: transparent;
  border-color: rgba(61, 224, 255, 0.16);
}

.pf-link {
  color: var(--text);
  text-decoration: none;
}

.pf-link:hover,
.pf-link:focus-visible {
  border-color: var(--pf-accent);
  outline: none;
}

/* Top row: hero | gallery | actions */
.pf-top {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(8.5rem, 10rem);
  gap: 0.6rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.pf-hero {
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(61, 224, 255, 0.2);
  background: rgba(2, 8, 20, 0.6);
}

.pf-hero {
  position: relative;
}

.pf-hero-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.pf-hero-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease), filter 0.3s var(--ease);
}

.pf-hero-btn:hover img,
.pf-hero-btn:focus-visible img {
  transform: scale(1.025);
  filter: brightness(1.08);
}

.pf-hero-btn:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: -2px;
}

.pf-hero-hint {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(2, 8, 20, 0.7);
  border: 1px solid rgba(61, 224, 255, 0.3);
  opacity: 0.85;
}

.pf-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.35rem;
  align-content: stretch;
  min-height: 0;
}

.pf-thumb {
  position: relative;
  padding: 0;
  min-height: 2.6rem;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(61, 224, 255, 0.18);
  background: rgba(2, 8, 20, 0.55);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.pf-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  transition: opacity 0.18s var(--ease);
}

.pf-thumb:hover img,
.pf-thumb:focus-visible img,
.pf-thumb.is-on img {
  opacity: 1;
}

.pf-thumb:focus-visible {
  outline: none;
  border-color: var(--pf-accent);
}

.pf-thumb.is-on {
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 1px var(--pf-accent), 0 0 12px -2px var(--pf-accent);
}

.pf-thumb--empty {
  display: grid;
  place-items: center;
  cursor: default;
  border-style: dashed;
  border-color: rgba(61, 224, 255, 0.12);
  background: repeating-linear-gradient(135deg, rgba(61, 224, 255, 0.025) 0 6px, transparent 6px 12px);
  color: rgba(184, 220, 255, 0.22);
  font-family: var(--font-display);
  font-size: 0.75rem;
}

.pf-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 0.75rem;
  background:
    radial-gradient(ellipse at 50% 40%, var(--pf-accent-soft), transparent 70%),
    repeating-linear-gradient(0deg, rgba(61, 224, 255, 0.04) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(61, 224, 255, 0.04) 0 1px, transparent 1px 18px);
}

.pf-ph-mark {
  font-size: 1.4rem;
  color: var(--pf-accent);
  opacity: 0.6;
}

.pf-ph b {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.pf-ph span:last-child {
  font-family: var(--font-display);
  font-size: 0.44rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Action buttons column */
.pf-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pf-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(8, 28, 58, 0.55);
  border: 1px solid var(--pf-accent-line);
  border-radius: 1.2rem 4px 4px 1.2rem;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s var(--ease);
}

.pf-action-pip {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pf-accent);
  opacity: 0.6;
}

.pf-action:hover:not(:disabled),
.pf-action:focus-visible {
  outline: none;
  border-color: var(--pf-accent);
  background: var(--pf-accent-soft);
  box-shadow: 0 0 12px -3px var(--pf-accent);
}

.pf-action--primary {
  color: #041018;
  background: linear-gradient(135deg, #7ef0ff, #2b9bff);
  border-color: transparent;
}

.pf-action--primary .pf-action-pip {
  background: #041018;
  opacity: 0.55;
}

.pf-action--primary:hover:not(:disabled),
.pf-action--primary:focus-visible {
  color: #041018;
  background: linear-gradient(135deg, #a6f5ff, #4aadff);
}

.pf-action.is-playing {
  border-color: var(--pf-accent);
  box-shadow: 0 0 12px -2px var(--pf-accent);
}

.pf-action.is-playing .pf-action-pip {
  opacity: 1;
  animation: pf-pip-pulse 1.1s ease-in-out infinite;
}

.pf-action:disabled {
  cursor: default;
  opacity: 0.42;
}

/* Bottom: overview + AI functions | main functions */
.pf-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(13rem, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.pf-col-main {
  display: grid;
  gap: 0.7rem;
}

.pf-sec h4 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pf-accent);
}

.pf-sec h4::before {
  content: "";
  width: 0.8rem;
  height: 0.3rem;
  border-radius: 0.25rem 0.06rem 0.06rem 0.25rem;
  background: var(--pf-accent);
  opacity: 0.7;
}

.pf-sec p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.pf-sec p + p {
  margin-top: 0.45rem;
}

.pf-fn-list,
.pf-main-list {
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.pf-fn-list {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.pf-fn-list li,
.pf-main-list li {
  padding: 0.38rem 0.6rem;
  border: 1px solid rgba(61, 224, 255, 0.1);
  border-left: 2px solid var(--pf-accent-line);
  border-radius: 2px 6px 6px 2px;
  background: rgba(4, 14, 32, 0.38);
  font-size: 0.8rem;
  line-height: 1.4;
}

.pf-fn-list strong,
.pf-main-list strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.pf-fn-detail {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.pf-col-side {
  padding: 0.6rem;
  border: 1px solid rgba(61, 224, 255, 0.12);
  border-radius: 8px;
  background: rgba(2, 8, 20, 0.35);
}

.pf-main-list li {
  background: transparent;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}

/* Placeholder copy (for Austin to fill in) */
.pf-tbd-chip {
  display: inline-block;
  vertical-align: 0.08em;
  margin-right: 0.45rem;
  padding: 0.12rem 0.4rem;
  font-family: var(--font-display);
  font-size: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffba40;
  border: 1px dashed rgba(255, 186, 64, 0.55);
  border-radius: 3px;
}

.pf-sec .is-tbd,
.pf-fn-list li.is-tbd,
.pf-main-list li.is-tbd {
  font-style: italic;
  color: var(--text-dim);
}

.pf-fn-list li.is-tbd,
.pf-main-list li.is-tbd {
  border-style: dashed;
  border-left-style: solid;
  border-left-color: rgba(255, 186, 64, 0.45);
}

.pf-fn-list li.is-tbd strong,
.pf-main-list li.is-tbd strong {
  display: inline;
  font-weight: 500;
  color: var(--text-dim);
}

.pf-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 1rem;
}

/* ── Lightbox ── */
.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  background: rgba(1, 4, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.pf-lightbox.is-open {
  opacity: 1;
}

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

.pf-lb-frame {
  width: min(1400px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  border: 1px solid rgba(61, 224, 255, 0.35);
  border-radius: 14px;
  background: rgba(4, 12, 28, 0.85);
  box-shadow: 0 0 40px rgba(43, 155, 255, 0.2);
}

.pf-lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.3rem;
}

.pf-lb-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.pf-lb-close {
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text);
  background: rgba(8, 28, 58, 0.6);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.pf-lb-close:hover,
.pf-lb-close:focus-visible {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(61, 224, 255, 0.4);
}

.pf-lb-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

.pf-lb-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
  border-radius: 8px;
}

.pf-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text);
  background: rgba(2, 8, 20, 0.7);
  border: 1px solid rgba(61, 224, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
}

.pf-lb-nav:hover,
.pf-lb-nav:focus-visible {
  outline: none;
  border-color: var(--cyan);
}

.pf-lb-prev { left: 0.6rem; }
.pf-lb-next { right: 0.6rem; }

.pf-lb-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@keyframes pf-pip-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .pf-top {
    grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 10rem);
  }
  .pf-hero {
    grid-column: 1 / -1;
  }
  .pf-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: auto;
  }
  .pf-thumb {
    aspect-ratio: 4 / 3;
  }
  .pf-actions {
    justify-content: center;
  }
}

@media (max-width: 860px) {
  .pf-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .hud-projects .hud-chrome--projects {
    height: auto;
    max-height: calc(100vh - 5.5rem - var(--helm-clearance, 8.75rem) + 1.2rem);
  }
  .pf {
    padding: 0.45rem 0.5rem 0.6rem;
  }
  .pf-tab {
    font-size: 0.5rem;
    padding: 0.45rem 0.75rem 0.4rem 0.6rem;
  }
  .pf-sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0.5rem;
    gap: 0.5rem;
    overflow-y: auto;
  }
  .pf-nav {
    border-right: 0;
    border-bottom: 1px solid rgba(61, 224, 255, 0.1);
    padding: 0 0 0.45rem;
  }
  .pf-nav-list {
    max-height: 7.5rem;
  }
  .pf-entry {
    overflow: visible;
  }
  .pf-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .pf-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pf-thumb--empty {
    display: none;
  }
  .pf-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pf-action {
    flex: 1 1 8rem;
  }
  .pf-entry-head {
    flex-direction: column;
  }
  .pf-badges {
    justify-content: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Load sequence (driven by js/projects-folders.js → ANIM config).
   Same easing, timing and door vocabulary for every folder and entry.
   Defaults below are overwritten from the JS config on #pf-root.
   ═══════════════════════════════════════════════════════════════════ */
.pf {
  --pf-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --pf-door-ease: cubic-bezier(0.76, 0, 0.24, 1);
  --pf-door-dur: 400ms;
  --pf-item-dur: 230ms;
  --pf-nav-dur: 150ms;
  --pf-fade-out: 130ms;
  --pf-reduced-fade: 180ms;
  --pf-door-white: #f3f8ff;
}

@keyframes pf-rise {
  from { opacity: 0; transform: translateY(6px); }
}
@keyframes pf-slide {
  from { opacity: 0; transform: translateX(-10px); }
}
@keyframes pf-fade {
  from { opacity: 0; }
}
@keyframes pf-scan {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}
@keyframes pf-caret-blink {
  50% { opacity: 0; }
}

/* Old content out (very fast) */
.pf-entry.is-leaving,
.pf-nav-list.is-leaving,
.pf-nav-head.is-leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--pf-fade-out) linear;
}

/* 1 · Left nav: quick stagger, only when a folder (re)opens */
.pf-nav-list.pf-nav-seq:not(.is-in) > li {
  opacity: 0;
}
.pf-nav-list.pf-nav-seq.is-in > li {
  animation: pf-slide var(--pf-nav-dur) var(--pf-ease) var(--pf-delay, 0ms) backwards;
}

/* Header + section titles settle in with the sheet */
.pf-seq .pf-entry-head,
.pf-seq .pf-sec h4 {
  animation: pf-fade 200ms var(--pf-ease) backwards;
}

/* 2–3 · Diagonal sliding doors (hero + every gallery thumbnail).
   The overlay is the mask; the two halves split along the
   top-right → bottom-left diagonal and slide out to opposite corners. */
.pf-doors {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.pf-door {
  position: absolute;
  inset: 0;
  transition: transform var(--pf-door-dur) var(--pf-door-ease) var(--pf-delay, 0ms);
  will-change: transform;
}
.pf-door--a {
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background: linear-gradient(to bottom right, var(--pf-door-white) 0 46%, #c9f4ff 49.4%, var(--pf-accent) 50%);
}
.pf-door--b {
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom right, var(--pf-accent) 50%, #c9f4ff 50.6%, var(--pf-door-white) 54% 100%);
}
.pf-doors.is-open > .pf-door--a,
.pf-gallery.is-open .pf-doors > .pf-door--a {
  transform: translate(-101%, -101%);
}
.pf-doors.is-open > .pf-door--b,
.pf-gallery.is-open .pf-doors > .pf-door--b {
  transform: translate(101%, 101%);
}
/* White "building" panel: faint grid + a scan sweep until the doors open */
.pf-hero > .pf-doors > .pf-door {
  background-size: 100% 100%;
}
.pf-hero > .pf-doors::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(61, 224, 255, 0.28), transparent) no-repeat,
    repeating-linear-gradient(0deg, rgba(30, 90, 140, 0.06) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(30, 90, 140, 0.06) 0 1px, transparent 1px 18px);
  background-size: 35% 100%, auto, auto;
  animation: pf-scan 0.9s linear infinite;
  transition: opacity 120ms linear;
}
.pf-hero > .pf-doors.is-open::after {
  opacity: 0;
}

/* 4 · Action column, 6 · AI Functions cards, 7 · Main Functions buttons */
.pf-seq .pf-actions:not(.is-in) > .pf-action,
.pf-seq .pf-fn-list:not(.is-in) > li,
.pf-seq .pf-main-list:not(.is-in) > li {
  opacity: 0;
}
.pf-seq .pf-actions.is-in > .pf-action,
.pf-seq .pf-fn-list.is-in > li,
.pf-seq .pf-main-list.is-in > li {
  animation: pf-rise var(--pf-item-dur) var(--pf-ease) var(--pf-delay, 0ms) backwards;
}

/* Reserved action slot (rename later via ACTION_SLOT in the JS) */
.pf-action--slot,
.pf-action--slot:disabled {
  border-style: dashed;
  background: rgba(8, 28, 58, 0.3);
  color: var(--text-dim, #8fb4d8);
  opacity: 0.7;
}
.pf-action--slot .pf-action-pip {
  background: transparent;
  border: 1px dashed var(--pf-accent);
}

/* 5 · Project Overview AI-typing stream (full text always in the DOM) */
.pf-rest {
  color: transparent;
}
.pf-caret {
  display: none;
  width: 2px;
  height: 1em;
  margin: 0 1px;
  vertical-align: -0.12em;
  background: var(--pf-accent);
  box-shadow: 0 0 6px var(--pf-accent);
  opacity: 0.85;
}
.pf-sec--overview p.is-typing .pf-caret {
  display: inline-block;
  animation: pf-caret-blink 0.5s steps(1) infinite;
}
.pf-sec--overview.is-streaming,
.pf-sec--overview.pf-ov-pending {
  cursor: pointer;
}
.pf-sec--overview.is-streaming p:not(.is-on) .pf-tbd-chip,
.pf-sec--overview.pf-ov-pending .pf-tbd-chip {
  opacity: 0;
}
.pf-sec--overview.is-streaming p.is-on .pf-tbd-chip {
  animation: pf-fade 160ms var(--pf-ease) backwards;
}

/* 9 · Reduced motion: no doors, no streaming — a short fade only */
.pf-seq--reduced {
  animation: pf-fade var(--pf-reduced-fade) linear backwards;
}

@media (prefers-reduced-motion: reduce) {
  .pf-doors,
  .pf-caret {
    display: none !important;
  }
  .pf-nav-list.pf-nav-seq > li,
  .pf-seq .pf-entry-head,
  .pf-seq .pf-sec h4,
  .pf-seq .pf-actions > .pf-action,
  .pf-seq .pf-fn-list > li,
  .pf-seq .pf-main-list > li {
    animation: none !important;
    opacity: 1 !important;
  }
  .pf-rest {
    color: inherit;
  }
  .pf-hero-btn img,
  .pf-lightbox {
    transition: none;
  }
  .pf-action.is-playing .pf-action-pip {
    animation: none;
  }
}

/* ── Gallery: logo + 2 front ends on top, 3 back ends underneath ── */
.pf-thumb--front img,
.pf-thumb--back img {
  object-position: 50% 0;
}

.pf-thumb--logo {
  background: radial-gradient(circle at 50% 45%, rgba(61, 224, 255, 0.14), rgba(2, 8, 20, 0.88) 72%);
}

.pf-thumb--logo img {
  object-fit: contain;
  padding: 10% 14%;
  opacity: 0.94;
}

.pf-hero-btn img.is-logo {
  object-fit: contain;
  padding: 9% 22%;
  background: radial-gradient(circle at 50% 45%, rgba(61, 224, 255, 0.14), rgba(2, 8, 20, 0.9) 70%);
}

.pf-thumb-tag {
  position: absolute;
  left: 0.22rem;
  bottom: 0.22rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.34rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.16rem 0.32rem;
  border-radius: 999px;
  color: var(--text);
  background: rgba(2, 8, 20, 0.8);
  border: 1px solid rgba(61, 224, 255, 0.28);
  pointer-events: none;
}

.pf-thumb--back .pf-thumb-tag {
  border-color: rgba(255, 184, 76, 0.4);
}

.pf-lb-stage img.is-logo {
  width: min(56vw, 640px);
  aspect-ratio: 16 / 10;
  padding: 2.5rem;
  background: radial-gradient(circle at 50% 45%, rgba(61, 224, 255, 0.14), rgba(2, 8, 20, 0.92) 70%);
}

@media (max-width: 1100px) {
  .pf-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pf-thumb {
    aspect-ratio: 16 / 10;
  }
}

/* ── "Visit site" go action (teal-green, matches the cyan accents) ── */
.pf-action.pf-action--visit {
  text-decoration: none;
  color: #dcfff2;
  background: linear-gradient(135deg, rgba(14, 72, 62, 0.62), rgba(8, 40, 54, 0.62));
  border-color: rgba(62, 230, 170, 0.55);
  box-shadow: inset 0 0 0 1px rgba(62, 230, 170, 0.08), 0 0 10px -5px rgba(62, 230, 170, 0.7);
}

.pf-action--visit .pf-action-pip {
  background: #3ee6aa;
  opacity: 0.9;
  box-shadow: 0 0 6px rgba(62, 230, 170, 0.75);
}

.pf-action-go {
  margin-left: auto;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.75;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.pf-action.pf-action--visit:hover:not(:disabled),
.pf-action.pf-action--visit:focus-visible {
  color: #ffffff;
  border-color: #3ee6aa;
  background: linear-gradient(135deg, rgba(20, 96, 80, 0.7), rgba(10, 52, 66, 0.7));
  box-shadow: 0 0 14px -3px rgba(62, 230, 170, 0.75);
}

.pf-action--visit:hover .pf-action-go,
.pf-action--visit:focus-visible .pf-action-go {
  opacity: 1;
  transform: translate(2px, -2px);
}
