/* ==========================================================================
   HumiAct Project Page — Clean Researcher Aesthetic + fayo.ai Personal Touch
   No SaaS marketing cards, no heavy shadows, no AI-template clutter.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --paper-warm: #faf7f4;
  --ink: #111827;
  --ink-body: #2c3440;
  --ink-muted: #5b6472;
  --rule: #e6e7eb;
  --rule-strong: #1f2937;

  /* Cobalt accent directly from fayo.ai logo + deep academic pine for subtle highlight */
  --cobalt: #0a3bb5;
  --cobalt-soft: #eef3fc;
  --pine: #0f6b5e;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max-w: 980px;
  --prose-w: 760px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-body);
  background: var(--bg);
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--cobalt);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Minimal Top Bar (fayo.ai cobalt emblem + quiet text links)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fayo-home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
}

.fayo-home-link:hover {
  text-decoration: none;
  color: var(--cobalt);
}

.fayo-logo {
  height: 24px;
  width: auto;
}

.fayo-domain {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.crumb-sep {
  color: #cbd5e1;
  font-size: 14px;
}

.crumb-current {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.crumb-current:hover {
  text-decoration: none;
  color: var(--cobalt);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--cobalt);
  text-decoration: none;
}

/* ==========================================================================
   Classic Academic Header & Hero Teaser Video
   ========================================================================== */
.hero {
  padding: 46px 0 28px;
}

.paper-title {
  margin: 0 auto 22px;
  max-width: 860px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(26px, 3.6vw, 39px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.authors {
  text-align: center;
  margin: 0 auto 16px;
  font-size: 16.5px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 20px;
  row-gap: 4px;
}

.authors sup {
  color: var(--cobalt);
  font-size: 0.72em;
  font-weight: 600;
  margin-left: 1.5px;
}

.author-link {
  color: var(--ink);
  border-bottom: 1px solid #94a3b8;
  padding-bottom: 1px;
}

.author-link:hover {
  color: var(--cobalt);
  border-bottom-color: var(--cobalt);
  text-decoration: none;
}

/* Plain clean inline affiliations (no boxed pills) */
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  max-width: 880px;
  margin: 0 auto 26px;
  font-size: 14px;
  color: var(--ink-muted);
}

.aff-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aff-item sup {
  color: var(--cobalt);
  font-weight: 600;
  font-size: 11px;
  margin-right: 1px;
}

.aff-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
}

.aff-logo-honor {
  height: 14px;
}

/* Classic Nerfies-style dark pill buttons */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 34px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 17px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #d1d5db;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.link-pill:hover {
  text-decoration: none;
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: var(--cobalt-soft);
}

.link-pill-dark {
  background: #1f242d;
  border-color: #1f242d;
  color: #ffffff;
}

.link-pill-dark:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #ffffff;
}

/* Hero Teaser Video (Full-width centerpiece, zero overlays) */
.teaser-block {
  margin: 0 auto;
}

.teaser-frame {
  background: #0d1117;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.teaser-frame video {
  width: 100%;
  height: auto;
  display: block;
  background: #0d1117;
}

.teaser-caption-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
}

.teaser-caption {
  margin: 0;
  font-size: 14.3px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.teaser-caption strong {
  color: var(--ink);
}

.teaser-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.speed-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.rate-btn {
  border: none;
  background: #ffffff;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 8px;
  cursor: pointer;
  border-right: 1px solid var(--rule);
}

.rate-btn:last-child {
  border-right: none;
}

.rate-btn.is-active {
  background: var(--cobalt-soft);
  color: var(--cobalt);
  font-weight: 600;
}

.text-action-btn {
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.text-action-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

/* ==========================================================================
   fayo.ai-Inspired Pixel-Art Divider Strip (with subtle warm hex paper motif)
   ========================================================================== */
.pixel-strip {
  margin: 12px 0 8px;
  padding: 10px 0 6px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  background-color: #fbf7f4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 98' fill='none' stroke='%23e7d9d2' stroke-width='1.1'/%3E%3C/svg%3E");
  background-size: 56px 98px;
  border: 1px solid #f0e6e0;
  overflow: hidden;
}

.pixel-strip-mini {
  margin: 10px 0 6px;
  padding: 6px 0 4px;
}

.pixel-scene {
  width: 100%;
  height: auto;
  max-height: 76px;
  display: block;
  image-rendering: pixelated;
}

.pixel-strip-mini .pixel-scene {
  max-height: 46px;
}

/* Gentle, subtle 2-step pixel animation */
@keyframes pxBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-1px); }
}

@keyframes pxFlutter {
  0%, 100% { transform: translate(0px, 0px); }
  50% { transform: translate(1.5px, -2px); }
}

@keyframes pxDrift {
  0%, 100% { transform: translateX(0px); }
  50% { transform: translateX(-5px); }
}

@keyframes pxHop {
  0% { transform: translateY(0px); }
  40% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.px-cat { animation: pxBob 1.1s steps(2, end) infinite; }
.px-robot { animation: pxBob 1.3s steps(2, end) infinite; }
.px-bird { animation: pxBob 1.5s steps(2, end) infinite; }
.px-butterfly { animation: pxFlutter 1.4s steps(2, end) infinite; }
.px-cloud { animation: pxDrift 9s steps(6, end) infinite; }

.pixel-strip.is-hopping .px-cat,
.pixel-strip.is-hopping .px-robot {
  animation: pxHop 0.42s steps(3, end) 1;
}

/* ==========================================================================
   Content Sections & Academic Typography
   ========================================================================== */
.section {
  padding: 44px 0;
}

.section-rule {
  border-top: 1px solid var(--rule);
}

.prose-col {
  max-width: var(--prose-w);
  margin: 0 auto;
}

.prose-spaced {
  margin-top: 34px;
}

.section-heading {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.subsection-heading {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.prose-col p,
.tab-prose {
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-body);
  text-align: justify;
  text-justify: inter-word;
}

.prose-col p:last-child {
  margin-bottom: 0;
}

.prose-col code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}

.section-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 28px;
  margin-bottom: 24px;
}

.section-note {
  margin: 0;
  max-width: 540px;
  font-size: 14.3px;
  line-height: 1.58;
  color: var(--ink-muted);
}

/* Minimal Underlined Tabs (Academic Notebook Style) */
.underline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
}

.u-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 7px 2px 9px;
  font-family: var(--font-sans);
  font-size: 13.8px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.u-tab:hover {
  color: var(--ink);
}

.u-tab.is-active {
  color: var(--cobalt);
  font-weight: 600;
}

.u-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--cobalt);
}

/* ==========================================================================
   Paper Figures (Flat, Crisp, Click-to-Zoom)
   ========================================================================== */
.paper-figure {
  margin: 26px 0 0;
  padding: 0;
}

.paper-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.figure-zoomable img {
  cursor: zoom-in;
  transition: border-color 0.16s ease;
}

.figure-zoomable:hover img {
  border-color: #94a3b8;
}

.paper-figure figcaption {
  margin-top: 9px;
  font-size: 13.6px;
  line-height: 1.58;
  color: var(--ink-muted);
}

.paper-figure figcaption strong {
  color: var(--ink);
}

.fig-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.fig-grid-asym {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.38fr);
  gap: 20px;
  margin-top: 18px;
}

.fig-grid-2 .paper-figure,
.fig-grid-asym .paper-figure {
  margin-top: 0;
}

/* ==========================================================================
   Rollout Video Grid (Clean, Flat, Unobstructed Frames)
   ========================================================================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 20px;
}

.video-item {
  display: flex;
  flex-direction: column;
}

.video-item.is-hidden {
  display: none;
}

.video-box {
  background: #0d1117;
  border: 1px solid var(--rule);
  border-radius: 7px;
  overflow: hidden;
}

.video-box video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0d1117;
}

.video-info {
  padding-top: 9px;
}

.video-info-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.video-title {
  margin: 0;
  font-size: 14.8px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.video-right-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.video-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.video-tag.is-real {
  color: var(--pine);
  font-weight: 600;
}

.mini-expand {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
}

.mini-expand:hover {
  color: var(--cobalt);
}

.video-desc {
  margin: 4px 0 0;
  font-size: 13.4px;
  line-height: 1.52;
  color: var(--ink-muted);
}

/* ==========================================================================
   Authentic Booktabs Academic Tables (No Admin-Dashboard Boxes)
   ========================================================================== */
.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.tab-prose {
  max-width: var(--max-w);
  margin-bottom: 22px;
}

.table-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

.table-wrap {
  margin-bottom: 8px;
}

.table-caption {
  margin: 0 0 8px;
  font-size: 13.6px;
  line-height: 1.52;
  color: var(--ink-muted);
}

.table-caption strong {
  color: var(--ink);
}

.table-scroll {
  overflow-x: auto;
}

.booktabs {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.4px;
  font-variant-numeric: tabular-nums;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 2px solid var(--rule-strong);
}

.booktabs th,
.booktabs td {
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}

.booktabs thead th {
  font-weight: 600;
  font-size: 12.6px;
  color: var(--ink);
  border-bottom: 1px solid #cbd5e1;
}

.booktabs thead tr.subhead th {
  border-bottom: 1.2px solid var(--rule-strong);
}

.booktabs thead tr:only-child th {
  border-bottom: 1.2px solid var(--rule-strong);
}

.booktabs tbody tr:hover {
  background: #f9fafb;
}

.booktabs .align-left {
  text-align: left;
  padding-left: 6px;
}

.booktabs tr.row-ours {
  background: #f4f7fd;
  border-top: 1px solid #d7e2f7;
}

.booktabs tr.row-divider td {
  text-align: left;
  padding: 6px 6px 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: #fafafa;
}

.booktabs td.val-ours {
  color: var(--cobalt);
  font-weight: 700;
}

.booktabs td.val-bold {
  color: var(--ink);
  font-weight: 700;
}

.booktabs .dim {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 11.8px;
}

/* ==========================================================================
   BibTeX & Quiet Footer
   ========================================================================== */
.bib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bib-head .section-heading {
  margin: 0;
}

.bibtex-box {
  margin: 0;
  padding: 16px 18px;
  background: #f8f9fb;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--ink);
  overflow-x: auto;
}

.footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0;
  font-size: 13.2px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}

.footer-brand:hover {
  text-decoration: none;
  color: var(--cobalt);
}

.fayo-logo-footer {
  height: 22px;
  width: auto;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-meta a {
  color: var(--ink-muted);
}

.footer-meta a:hover {
  color: var(--cobalt);
}

/* ==========================================================================
   Clean Lightbox Modal
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1060px, 96vw);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.36);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #fafafa;
}

.lightbox-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.lightbox-tag {
  color: var(--cobalt);
  font-weight: 600;
}

.lightbox-counter {
  color: var(--ink-muted);
}

.lightbox-bar-actions {
  display: flex;
  gap: 6px;
}

.lb-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.lb-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.lb-btn.is-hidden {
  display: none;
}

.lightbox-stage {
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 70vh;
}

.lightbox-stage.is-image {
  background: #ffffff;
  padding: 16px;
}

.lightbox-stage video {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 66vh;
  object-fit: contain;
}

.lightbox-caption-bar {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--rule);
  background: #ffffff;
}

.lightbox-caption-bar h4 {
  margin: 0 0 3px;
  font-size: 14.8px;
  font-weight: 600;
  color: var(--ink);
}

.lightbox-caption-bar p {
  margin: 0;
  font-size: 13.4px;
  line-height: 1.54;
  color: var(--ink-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .table-two-col,
  .fig-grid-2,
  .fig-grid-asym {
    grid-template-columns: 1fr;
  }
  .teaser-caption-row {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero { padding: 30px 0 22px; }
  .section { padding: 34px 0; }
  .video-grid { grid-template-columns: 1fr; }
  .prose-col p, .tab-prose { text-align: left; }
}
