/* PAPAFLY Ultra A-grade layer — keeps tokens; elevates density & interaction */
:root {
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --gold-b: #e8d49a;
  --gold-line: rgba(196, 163, 90, .32);
  --gold-dim-bg: rgba(196, 163, 90, .08);
  --max-board: 1100px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Nav upgrade */
.nav {
  padding-top: calc(var(--space-md) + var(--safe-t));
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.nav.scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  border-bottom-color: var(--gold-line);
}
.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.nav-logo .nav-tag {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.nav-links a {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-links a:hover {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-dim-bg);
}
.nav-links a.cta {
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), var(--gold-b));
  border: 0;
  font-weight: 700;
}
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 5px 0 var(--gold), 0 -5px 0 var(--gold);
}
@media (max-width: 768px) {
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px 16px;
    background: rgba(13, 11, 8, .96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* Hero polish */
.hero {
  padding-bottom: var(--space-xl);
}
.hero-video-wrap {
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, .2),
    0 24px 80px rgba(0, 0, 0, .55),
    0 0 80px rgba(196, 163, 90, .06);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 640px;
  width: 100%;
  margin: var(--space-lg) auto 0;
  padding: 0 var(--space-md);
}
.hero-stat {
  padding: 12px 8px;
  border: 1px solid var(--border);
  background: rgba(26, 21, 16, .72);
  text-align: center;
  border-radius: 2px;
}
.hero-stat b {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 2px;
}
.hero-stat span {
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (max-width: 520px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Dual-track pills */
.tracks .track {
  border-radius: 999px;
  background: var(--gold-dim-bg);
  transition: border-color .2s, color .2s, transform .2s var(--ease-expo);
}
.tracks .track:hover {
  border-color: var(--gold);
  color: var(--text);
  transform: translateY(-1px);
}

/* Board bar + folds */
.board-wrap {
  max-width: var(--max-board);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}
.fold-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: var(--space-lg) 0 var(--space-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25);
  border-radius: 4px;
}
.fold-bar .meta {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .06em;
}
.fold-bar .meta b { color: var(--gold); }
.fold-bar .actions { display: flex; gap: 6px; }
.chip-btn {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  min-height: 32px;
  letter-spacing: .06em;
}
.chip-btn:hover {
  border-color: var(--gold-line);
  color: var(--gold);
}

.fold {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26, 21, 16, .96), rgba(18, 14, 10, .96));
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 4px;
}
.fold.is-open {
  border-color: var(--gold-line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.fold-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  text-align: left;
  min-height: 56px;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.fold-toggle:hover { background: var(--gold-dim-bg); }
.fold-k {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}
.fold-t {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.3;
}
.fold-m {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.4;
}
.fold-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fold-lab {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .08em;
}
.fold-chev {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dim);
  transition: transform .3s var(--ease-expo), color .2s, border-color .2s, background .2s;
}
.fold.is-open .fold-chev {
  transform: rotate(180deg);
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-dim-bg);
}
.fold-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .4s var(--ease-expo), opacity .25s;
  padding: 0 14px;
}
.fold.is-open .fold-body {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 0 14px 16px;
}
.fold-body > .inner {
  overflow: hidden;
  min-height: 0;
}
.fold:not(.is-open) > .fold-body {
  pointer-events: none;
  visibility: hidden;
}
.fold .lede {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Pipeline infographic */
.pipe {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 720px) {
  .pipe {
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
  }
  .pipe-arr { transform: none !important; }
}
.pipe-node {
  padding: 14px 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .22);
  text-align: center;
  cursor: pointer;
  transition: .22s var(--ease-expo);
  width: 100%;
  color: inherit;
  font: inherit;
}
.pipe-node:hover,
.pipe-node.active {
  border-color: var(--gold-line);
  background: var(--gold-dim-bg);
  transform: translateY(-1px);
}
.pipe-node .n {
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--gold);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.pipe-node h3 {
  font-size: .92rem;
  margin-bottom: 4px;
  color: var(--text);
}
.pipe-node p {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.pipe-arr {
  align-self: center;
  justify-self: center;
  color: var(--gold);
  opacity: .45;
  transform: rotate(90deg);
  font-family: var(--font-mono);
  font-size: 12px;
}
.pipe-detail {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, .28);
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: center;
}
.pipe-detail strong { color: var(--gold-b); }

/* Channel card polish */
.channels-grid {
  max-width: var(--max-board);
}
.channel-card {
  position: relative;
  overflow: hidden;
}
.channel-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.channel-card:hover::after { opacity: .6; }

/* Mission cards */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) {
  .mission-grid { grid-template-columns: 1fr; }
}
.mission-card {
  border: 1px solid var(--border);
  padding: 18px 16px;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
  text-align: left;
  transition: .22s var(--ease-expo);
  width: 100%;
  color: inherit;
  font: inherit;
}
.mission-card:hover,
.mission-card.active {
  border-color: var(--gold-line);
  background: var(--gold-dim-bg);
  transform: translateY(-1px);
}
.mission-card .mk {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--gold);
  margin-bottom: 8px;
}
.mission-card h3 {
  font-size: .95rem;
  margin-bottom: 6px;
  color: var(--text);
}
.mission-card p {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Products section frame */
.shop-frame {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(196, 163, 90, .05), transparent 60%),
    var(--bg);
}
.cat-bar {
  position: sticky;
  top: 56px;
  z-index: 40;
  background: rgba(13, 11, 8, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
  justify-content: flex-start;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-item {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cat-item.active {
  border-color: var(--gold-line);
  background: var(--gold-dim-bg);
  color: var(--gold);
}

/* Biz arch polish */
.biz-arch {
  background: var(--surface);
}
.biz-split {
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 4px;
}
.biz-col {
  background: rgba(0, 0, 0, .15);
}

/* YT / Discord polish */
.yt-card,
.discord-section {
  border-radius: 4px;
}
.yt-card {
  transition: border-color .2s, transform .2s var(--ease-expo);
}
.yt-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-2px);
}
.yt-card a { text-decoration: none; display: block; color: inherit; }

/* Sitemap polish */
.sitemap-grid {
  max-width: var(--max-board);
  margin: 0 auto;
}
.sitemap-group {
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .18);
  border-radius: 4px;
  min-height: 100%;
}
.sitemap-group:hover { border-color: var(--gold-line); }

/* Footer polish */
footer {
  margin-top: 0;
}
.footer-img {
  transition: opacity .4s, filter .4s;
}
footer:hover .footer-img {
  opacity: .75;
  filter: brightness(.78) sepia(.25);
}
.footer-copy {
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Toast */
.pf-toast {
  position: fixed;
  bottom: calc(22px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface);
  border: 1px solid var(--gold-line);
  color: var(--gold-b);
  padding: 10px 16px;
  font-size: .82rem;
  letter-spacing: .06em;
  opacity: 0;
  visibility: hidden;
  transition: .25s var(--ease-expo);
  z-index: 400;
  max-width: 88vw;
  pointer-events: none;
}
.pf-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fold-body,
  .pipe-node,
  .mission-card,
  .hero-video-wrap {
    transition: none !important;
    animation: none !important;
  }
}
