/* Project page styles. Builds on tokens/nav/btn/footer from home.css */

.p-wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.p-hero { position: relative; padding: 64px 0 40px; text-align: center; overflow: hidden; }
.p-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%);
}
.p-hero > * { position: relative; }
.venue-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.venue-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.p-title {
  font-size: clamp(32px, 5vw, 52px); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em;
  max-width: 820px; margin: 0 auto;
}
.p-title .grad-text { white-space: nowrap; }
@media (max-width: 480px) { .p-title .grad-text { white-space: normal; } }
.p-authors { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: 17px; font-weight: 500; }
.p-authors a { color: var(--text); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.p-authors a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.p-authors sup { color: var(--accent); font-weight: 600; margin-left: 1px; }
.p-affil { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; color: var(--text-2); font-size: 15px; }
.p-affil sup { color: var(--accent); margin-right: 2px; }
.p-note { margin-top: 6px; font-size: 13px; color: var(--text-3); }

.p-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.p-actions .btn { padding: 11px 20px; border-radius: 999px; }
.p-actions .size { font-family: var(--mono); font-size: 11.5px; font-weight: 500; opacity: .55; margin-left: 2px; }
.btn-primary .size { opacity: .8; }

/* ---------- Figures ---------- */
.fig { margin: 0; }
.fig-frame {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); cursor: zoom-in; overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}
.fig-frame:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.fig-frame img { width: 100%; height: auto; margin: 0 auto; }
.fig-frame.narrow img { max-width: 680px; }
.fig figcaption { margin: 14px 4px 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.fig figcaption b { color: var(--text); font-weight: 600; margin-right: 4px; }
.fig + .fig { margin-top: 36px; }
.teaser { margin-top: 8px; }

/* ---------- Sections ---------- */
.p-sec { padding: 56px 0; border-top: 1px solid var(--border); }
.p-sec h2 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.p-sec h2::before { content: ""; width: 4px; height: 22px; border-radius: 2px; background: var(--grad); }
.p-sec p { color: var(--text-2); font-size: 16px; line-height: 1.8; }
.p-sec p + p { margin-top: 14px; }
.p-sec p strong { color: var(--text); font-weight: 600; }
.p-sec .lead { margin-bottom: 28px; }
.p-sec .math { font-family: "Times New Roman", Georgia, serif; font-style: italic; font-size: 1.08em; color: var(--text); }

/* Highlight cards (key ideas) */
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 4px 0 32px; }
.idea { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.idea .n { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.idea h3 { font-size: 15.5px; font-weight: 700; margin: 6px 0 4px; }
.idea p { font-size: 14px; line-height: 1.6; }

/* Metric pills */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 28px; }
.metric {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
}
.metric .sym {
  flex: none; font-family: "Times New Roman", Georgia, serif; font-style: italic; font-size: 20px; font-weight: 700;
  color: #fff; background: var(--grad); border-radius: 10px; padding: 6px 12px; line-height: 1.2;
}
.metric .sym sub { font-size: .65em; }
.metric p { font-size: 14.5px; line-height: 1.6; }

/* Video */
.video-frame {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  border: 1px solid var(--border); box-shadow: var(--shadow); aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }

/* Code card */
.repo {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.repo:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.repo-icon { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.repo-icon svg { width: 26px; height: 26px; }
.repo-body { min-width: 0; flex: 1; }
.repo-name { display: block; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.repo-name span { color: var(--text-3); font-weight: 500; }
.repo-desc { display: block; font-size: 14px; color: var(--text-2); margin-top: 2px; }
.repo-arrow { flex: none; color: var(--text-3); transition: transform .2s, color .2s; }
.repo:hover .repo-arrow { color: var(--accent); transform: translateX(4px); }
.repo-arrow svg { width: 20px; height: 20px; }

/* BibTeX */
.bib { position: relative; }
.bib pre {
  margin: 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; overflow-x: auto;
}
.bib .k { color: var(--accent); }
.bib .f { color: var(--accent-2); }
.copy-btn {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); transition: all .2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.done { color: #10b981; border-color: #10b981; }
.copy-btn svg { width: 14px; height: 14px; }

.ack { font-size: 14.5px !important; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 18, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 32px; cursor: zoom-out;
}
.lightbox.open { display: flex; animation: fade .2s ease; }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox-close {
  position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff;
  cursor: pointer; display: grid; place-items: center;
}
.lightbox-close svg { width: 20px; height: 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .p-hero { padding: 44px 0 28px; }
  .p-authors { font-size: 16px; }
  .ideas, .metrics { grid-template-columns: 1fr; }
  .fig-frame { padding: 10px; border-radius: 12px; }
  .p-sec { padding: 44px 0; }
  .repo-desc { display: none; }
  .lightbox { padding: 12px; }
}
