/*
 * ==========================================================
 *  Hoi! Dataset Website — Custom Styles
 *  Brand color: #E87461 (coral/salmon)
 * ==========================================================
 *  DEPLOYMENT NOTES:
 *  1. Logo images present: LogoHoi.png, TextHoi.png
 *  2. Teaser image present: Teaser.png
 *  3. Add paper figures to static/images/figures/:
 *     - forces_figure.png
 *     - HoiPipeline1-2.png
 *     - tactile_forces.png
 * ==========================================================
 */

/* ===== Intro Overlay ===== */
#intro-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #ffffff;
}
#intro-canvas { width: 100%; height: 100%; display: block; }
#intro-fade {
  position: absolute; inset: 0; background: #fff;
  opacity: 0; pointer-events: none;
}
#intro-logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
#intro-logo img { height: 140px; width: auto; opacity: 0.9; }
#intro-logo p { color: #000; font-size: 1.35rem; font-weight: 700; margin-top: .8rem; line-height: 1.6; }
#intro-skip {
  position: absolute; bottom: 2rem; right: 2rem;
  background: rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.5); padding: .4rem .9rem; border-radius: 999px;
  font-size: .75rem; cursor: pointer; transition: all .2s;
}
#intro-skip:hover { background: rgba(0,0,0,0.12); color: #000; }

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff; color: #1a1a1a; line-height: 1.7; overflow-x: hidden;
}
a { color: #1d4ed8; text-decoration: none; transition: color .2s; }
a:hover { color: #1e40af; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed; left: 0; top: 0; width: 220px; height: 100vh;
  background: rgba(10,10,18,0.96); backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 100; display: flex; flex-direction: column;
  padding: 1.5rem 1.25rem; transition: transform .3s;
}
.sidebar-logo { text-align: center; margin-bottom: .5rem; }
.sidebar-logo img { width: 130px; height: auto; display: block; margin: 0 auto; }
.sidebar-subtitle {
  font-size: .6rem; color: #777; text-align: center;
  margin-bottom: 1.5rem; line-height: 1.4;
}
.sidebar nav { flex: 1; }
.sidebar nav a {
  display: block; padding: .5rem .7rem; margin-bottom: .1rem;
  border-radius: 8px; font-size: .82rem; font-weight: 500;
  color: #999; transition: all .2s;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(232,116,97,0.1); color: #E87461;
}
.sidebar-toggle {
  display: none; position: fixed; top: 1rem; left: 1rem;
  z-index: 200; background: rgba(10,10,18,0.9); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; width: 40px; height: 40px; border-radius: 8px;
  cursor: pointer; font-size: 1.1rem;
}

.main { margin-left: 220px; }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 2px; opacity: .3;
}
.hero-bg video { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: none;
}
.hero-content {
  position: relative; z-index: 2; text-align: center;
  max-width: 780px; padding: 2rem;
}
.hero-logo { margin-bottom: 1.2rem; }
.hero-logo img { height: 80px; width: auto; }
.hero-content h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero-content .tagline {
  font-size: 1.05rem; color: #444; margin-bottom: 1.8rem; max-width: 580px; margin-inline: auto;
}
.authors { font-size: .88rem; color: #333; margin-bottom: .4rem; }
.authors a { color: #1d4ed8; }
.authors sup { font-size: .6rem; color: #555; }
.affiliations { font-size: .72rem; color: #555; margin-bottom: 1.8rem; }

/* ===== Buttons ===== */
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  transition: all .25s; border: 1px solid transparent;
}
.btn-primary { background: #E87461; color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232,116,97,.35); color: #fff; }
.btn-dark { background: rgba(255,255,255,0.08); color: #ccc; border-color: rgba(255,255,255,0.12); }
.btn-dark:hover { background: rgba(255,255,255,0.14); color: #fff; }
.btn-disabled { background: rgba(255,255,255,0.03); color: #555; border-color: rgba(255,255,255,0.06); cursor: default; }

/* ===== Sections ===== */
.section { padding: 4.5rem 2rem; max-width: 1060px; margin: 0 auto; }
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: .4rem; }
.section-title .accent { color: #E87461; }
.section-divider { width: 50px; height: 3px; background: #E87461; border-radius: 2px; margin-bottom: 1.8rem; }

/* ===== Teaser ===== */
.teaser-wrap { padding: 1.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.teaser-wrap img {
  width: 100%; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ===== Stats ===== */
.stats-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem;
  padding: 2.5rem 2rem; max-width: 800px; margin: 0 auto;
}
.stat-item { text-align: center; }
.stat-num { font-size: 2.4rem; font-weight: 800; color: #E87461; }
.stat-label { font-size: .75rem; color: #444; margin-top: .15rem; }

/* ===== Abstract ===== */
.abstract-text { font-size: 1rem; color: #222; line-height: 1.85; max-width: 820px; }

/* ===== Overview Cards ===== */
.overview-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem; margin-top: 1.2rem;
}
.overview-card {
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px; padding: 1.3rem; transition: all .3s;
}
.overview-card:hover { border-color: rgba(232,116,97,0.2); background: rgba(255,255,255,0.04); }
.overview-card .card-icon { font-size: 1.3rem; margin-bottom: .6rem; color: #E87461; }
.overview-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: .4rem; color: #111; }
.overview-card p { font-size: .82rem; color: #444; line-height: 1.55; }

/* ===== Paper Figures ===== */
.fig-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.fig-full { grid-template-columns: 1fr; }
.fig-half { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .fig-half { grid-template-columns: 1fr; } }
.fig-card {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; overflow: hidden;
}
.fig-card img { width: 100%; display: block; }
.fig-cap {
  padding: .7rem 1rem; font-size: .78rem; color: #444; line-height: 1.45;
}
.fig-cap strong { color: #E87461; }

/* ===== Visualizer ===== */
.vis-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.vis-btn {
  padding: .4rem .9rem; border-radius: 999px; font-size: .78rem; font-weight: 500;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: #999; cursor: pointer; transition: all .2s;
}
.vis-btn:hover, .vis-btn.active {
  background: rgba(232,116,97,0.12); border-color: #E87461; color: #E87461;
}
.shuffle-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem 1rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: rgba(232,116,97,0.1); border: 1px solid rgba(232,116,97,0.25);
  color: #E87461; cursor: pointer; transition: all .2s; margin-bottom: 1.2rem;
}
.shuffle-btn:hover { background: rgba(232,116,97,0.2); }
.vid-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem;
}
.vid-card {
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05);
  transition: all .3s;
}
.vid-card:hover { border-color: rgba(232,116,97,0.25); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.vid-card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.vid-info { padding: .6rem .8rem; }
.vid-info .vtitle { font-size: .82rem; font-weight: 600; color: #111; }
.vid-info .vmeta { font-size: .68rem; color: #555; margin-top: .15rem; }
.vid-info .vtags { display: flex; gap: .3rem; margin-top: .35rem; flex-wrap: wrap; }
.tag { font-size: .62rem; padding: .15rem .45rem; border-radius: 999px; background: rgba(232,116,97,0.1); color: #E87461; font-weight: 500; }
.tag.blue { background: rgba(96,165,250,0.1); color: #60a5fa; }
.tag.green { background: rgba(52,211,153,0.1); color: #34d399; }
.tag.purple { background: rgba(167,139,250,0.1); color: #a78bfa; }

/* ===== Documentation ===== */
.docs-box {
  background: #f8f8f8; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px; padding: 2rem; max-height: 550px;
  overflow-y: auto; font-size: .88rem; color: #222;
}
.docs-box h1,.docs-box h2,.docs-box h3,.docs-box h4 { color: #111; margin-top: 1.3rem; margin-bottom: .6rem; }
.docs-box h1 { font-size: 1.4rem; }
.docs-box h2 { font-size: 1.2rem; border-bottom: 1px solid rgba(0,0,0,0.08); padding-bottom: .4rem; }
.docs-box code { background: rgba(0,0,0,0.06); padding: .12rem .35rem; border-radius: 4px; font-size: .78rem; color: #E87461; }
.docs-box pre { background: #f0f0f0; border: 1px solid rgba(0,0,0,0.08); border-radius: 8px; padding: .8rem; overflow-x: auto; margin: .8rem 0; }
.docs-box pre code { background: none; padding: 0; color: #333; }
.docs-box ul, .docs-box ol { padding-left: 1.4rem; margin: .4rem 0; }
.docs-box li { margin-bottom: .25rem; }
.docs-box strong { color: #111; }
.docs-box::-webkit-scrollbar { width: 5px; }
.docs-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ===== Team ===== */
.team-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-top: 1.2rem; }
.team-member { text-align: center; width: 120px; color: #222; }
.team-member:hover { color: #000; }
.avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(232,116,97,0.08);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .6rem; font-size: 1.3rem; color: #E87461; font-weight: 700;
  overflow: hidden; border: 2px solid rgba(232,116,97,0.15); transition: border-color .3s;
}
.team-member:hover .avatar { border-color: #E87461; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-member .name { font-size: .8rem; font-weight: 600; }
.team-member .affil { font-size: .65rem; color: #555; }

/* ===== Citation ===== */
.citation-box {
  background: #f4f4f4; border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px; padding: 1.2rem; overflow-x: auto; position: relative;
}
.citation-box pre { font-size: .78rem; color: #222; margin: 0; white-space: pre-wrap; }
.copy-btn {
  position: absolute; top: .6rem; right: .6rem;
  background: rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.12);
  color: #444; padding: .25rem .5rem; border-radius: 6px;
  font-size: .68rem; cursor: pointer;
}

/* ===== Affiliation Logos ===== */
.affil-logos {
  display: flex; flex-wrap: nowrap; align-items: center;
  justify-content: center; gap: 2rem; padding: 1rem 0;
}
.affil-logos img { height: 28px; width: auto; object-fit: contain; opacity: 0.75; transition: opacity .2s; }
.affil-logos img[alt="University of Freiburg"] { height: 120px; }
.affil-logos img[alt="University of Bonn"] { height: 40px; }
.affil-logos img[alt="Microsoft"] { height: 40px; }
.affil-logos img:hover { opacity: 1; }

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 2.5rem 2rem; margin-left: 220px;
  border-top: 1px solid rgba(0,0,0,0.1); font-size: .7rem; color: #555;
}

/* ===== Scene Selector ===== */
.scene-selector { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.scene-label { font-size: .82rem; font-weight: 600; color: #555; }
.scene-btn {
  padding: .4rem 1rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  border: 2px solid rgba(232,116,97,0.3); background: #fff; color: #888;
  cursor: pointer; transition: all .2s;
}
.scene-btn:hover { border-color: #E87461; color: #E87461; }
.scene-btn.active { background: #E87461; border-color: #E87461; color: #fff; }

/* ===== Sensor Grid ===== */
.sensor-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.2rem;
}
.sensor-card {
  border-radius: 12px; border: 1px solid rgba(0,0,0,0.08); overflow: hidden; background: #f8f8f8;
}
.sensor-card-header {
  padding: .55rem .9rem; font-weight: 600; font-size: .82rem; color: #111;
  display: flex; align-items: center; gap: .45rem;
  border-bottom: 1px solid rgba(0,0,0,0.06); background: #fff;
}
.sensor-card-header i { color: #E87461; }
.sensor-frame { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.sensor-placeholder {
  aspect-ratio: 4/3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #bbb; font-size: .85rem; gap: .5rem;
}
.sensor-placeholder i { font-size: 2rem; color: #E87461; }
.leica-section { margin-top: 2rem; }
.sensor-section-title {
  font-size: .95rem; font-weight: 600; color: #111;
  margin-bottom: .8rem; display: flex; align-items: center; gap: .5rem;
}
.sensor-section-title i { color: #E87461; }
.leica-controls { display: flex; gap: .4rem; margin-bottom: .8rem; }
#pointcloud-canvas { width: 100%; height: 450px; border-radius: 12px; display: block; border: 1px solid rgba(0,0,0,0.08); }
.pc-hint { font-size: .72rem; color: #888; margin-top: .5rem; text-align: center; }
@media (max-width: 700px) { .sensor-grid { grid-template-columns: 1fr; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .main, .footer { margin-left: 0; }
  .hero-content h1 { font-size: 1.7rem; }
  .hero-logo img { height: 55px; }
  .stat-num { font-size: 1.8rem; }
}
