/* TUT Vision showcase. Layout and typography follow the Nerfies template. */

:root {
  --accent: #4e008e;          /* Tampere University purple */
  --accent-soft: #f3ecfa;
  --ink: #1f1f24;
  --muted: #5d5d66;
  --line: #e6e4ea;
  --bg-alt: #faf9fc;
  --nav-h: 3.25rem;
  --t-navigation: #0b7a75;
  --t-aerial: #c2410c;
  --t-3d: #4e008e;
  --t-imaging: #1d4ed8;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: "Noto Sans", sans-serif;
  color: var(--ink);
  background: #fff;
}
a { color: var(--accent); }
a:hover { color: #7a2fc0; }

.title, .publication-title, .navbar, .button, .tag, .hero-kicker, .wall-caption, .person strong {
  font-family: "Google Sans", "Noto Sans", sans-serif;
}

/* ---------------------------------------------------------------- navbar */
.navbar { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); }
.brand-mark { font-family: "Google Sans", sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.brand-mark span { color: var(--accent); }
.navbar-item { font-size: 0.98rem; }
body { padding-top: var(--nav-h); }

/* ------------------------------------------------------------------ hero */
.hero { background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 100%); }
.hero .hero-body { padding: 4.5rem 1.5rem 3rem; }
.hero-kicker { text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); font-weight: 600; margin-bottom: 0.75rem; }
.publication-title { font-family: "Google Sans", sans-serif !important; }
.hero .publication-title { font-size: 3.4rem; }
.hero-sub { font-size: 1.3rem; color: var(--muted); max-width: 46rem; margin: 1rem auto 0.75rem; line-height: 1.55; }
.hero-pis { font-size: 1.1rem; margin-bottom: 1.25rem; }
.hero-pis a { font-weight: 600; }

.publication-links { margin-top: 0.75rem; }
.link-button { margin: 0.3rem 0.2rem; }

/* --------------------------------------------------------- overview wall */
.overview { padding-top: 2rem; }
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
  margin-top: 1.25rem;
}
.wall-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 4px 14px rgba(20, 0, 40, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wall-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20, 0, 40, 0.22); }
.wall-media { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.8rem 0.6rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff; display: flex; flex-direction: column; line-height: 1.25;
}
.wall-caption strong { color: #fff; font-size: 1.05rem; }
.wall-caption small { opacity: 0.85; font-size: 0.8rem; }
.wall-tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 1;
}
.wall-tile.theme-navigation::before { background: var(--t-navigation); }
.wall-tile.theme-aerial::before { background: var(--t-aerial); }
.wall-tile.theme-3d::before { background: var(--t-3d); }
.wall-tile.theme-imaging::before { background: var(--t-imaging); }

.filter-btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------------------------------------------------------- theme header */
.theme-header { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3rem 1.5rem 2.5rem; }
.theme-header .subtitle { color: var(--muted); max-width: 40rem; margin: 0.5rem auto 0; }
.theme-kicker { font-size: 2rem; margin-bottom: 0.25rem; }
.theme-header.theme-navigation .theme-kicker { color: var(--t-navigation); }
.theme-header.theme-aerial .theme-kicker { color: var(--t-aerial); }
.theme-header.theme-3d .theme-kicker { color: var(--t-3d); }
.theme-header.theme-imaging .theme-kicker { color: var(--t-imaging); }

/* --------------------------------------------------------------- project */
.project { padding: 4rem 1.5rem; }
.project + .project { border-top: 1px solid var(--line); }
.project .publication-title { font-size: 2.3rem; line-height: 1.2; margin-bottom: 1rem; }
.project-tags { margin-bottom: 1rem; }
.project-tags .tag { margin: 0.15rem; font-weight: 600; }
.tag:not(body).venue-tag { background: var(--ink); color: #fff; }
.tag:not(body).theme-tag { color: #fff; }
.tag:not(body).theme-navigation { background: var(--t-navigation); }
.tag:not(body).theme-aerial { background: var(--t-aerial); }
.tag:not(body).theme-3d { background: var(--t-3d); }
.tag:not(body).theme-imaging { background: var(--t-imaging); }

.publication-authors { color: var(--muted); }
.publication-authors a { color: hsl(204, 86%, 45%) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; }
.author-note { font-size: 0.85rem; margin-top: 0.2rem; }
.supervisor { margin-top: 0.4rem; font-size: 0.95rem; color: var(--muted); }
.supervisor a { font-weight: 600; }

.hero-media { margin: 2rem auto 0; text-align: center; }
.main-media {
  width: 100%; height: auto; max-height: 72vh; object-fit: contain;
  border-radius: 12px; background: #000; display: block; margin: 0 auto;
  box-shadow: 0 8px 28px rgba(20, 0, 40, 0.16);
}
img.main-media { background: transparent; }
.hero-media.is-portrait .main-media { width: auto; max-width: 100%; }

.tldr {
  margin: 1.75rem auto 2rem; max-width: 52rem;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 1rem 1.25rem; font-size: 1.12rem; line-height: 1.55;
}
.tldr-label {
  display: inline-block; margin-right: 0.6rem; padding: 0.05rem 0.55rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; vertical-align: 0.12em;
}
.abstract { font-size: 1.04rem; line-height: 1.7; }

.gallery { margin-top: 1rem; }
.gallery-item { margin: 0; }
.gallery-media { width: 100%; height: auto; border-radius: 10px; display: block; background: #000; }
img.gallery-media { background: transparent; max-height: 60vh; object-fit: contain; }
.gallery-item.is-portrait .gallery-media { aspect-ratio: 9 / 16; object-fit: cover; }
.gallery-item figcaption { font-size: 0.9rem; color: var(--muted); text-align: center; margin-top: 0.45rem; }
.project .hero-media + .tldr { margin-top: 1.75rem; }
.project .publication-links + .gallery { margin-top: 2rem; }

/* --------------------------------------------------------- YouTube facade */
.youtube-row { margin-top: 1rem; }
.yt-facade, .yt-frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden; background: #000;
}
.yt-facade { border: 0; padding: 0; cursor: pointer; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.15s; }
.yt-facade:hover img { opacity: 1; }
.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 4rem; color: #ff0033; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}
.yt-play::before { content: ""; position: absolute; inset: 30% 30%; background: #fff; z-index: -1; }
.yt-title {
  position: absolute; left: 0; right: 0; top: 0; padding: 0.6rem 0.8rem; text-align: left;
  background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); color: #fff;
  font-family: "Google Sans", sans-serif; font-size: 1rem;
}
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------------------ team */
.team { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 4rem 1.5rem; }
.team .subtitle { color: var(--muted); margin-bottom: 2rem !important; }
#people { margin-bottom: 2rem; }
.person {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1rem 0.5rem; border-radius: 12px; color: var(--ink); height: 100%;
  transition: background 0.15s;
}
.person:hover { background: #fff; color: var(--ink); }
.person img, .person .initials {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin-bottom: 0.7rem;
  box-shadow: 0 4px 12px rgba(20, 0, 40, 0.15);
}
.person .initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font: 700 2.1rem "Google Sans", sans-serif;
}
.person strong { font-size: 1.02rem; line-height: 1.3; }
.person small { color: var(--muted); margin-top: 0.25rem; line-height: 1.35; }
.person.is-pi strong { color: var(--accent); }

.footer { padding: 2.5rem 1.5rem 3rem; }

/* ------------------------------------------------------ presentation mode */
.present-overlay {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  background: rgba(20, 20, 26, 0.88); color: #fff; border-radius: 12px;
  overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  font-family: "Google Sans", sans-serif;
}
.present-bar { height: 4px; background: rgba(255, 255, 255, 0.15); }
#present-progress { height: 100%; width: 0; background: #b98cf0; }
.present-controls { display: flex; align-items: center; gap: 0.25rem; padding: 0.45rem 0.6rem; }
#present-label { margin-right: 0.5rem; font-size: 0.95rem; white-space: nowrap; }
.present-controls button {
  background: transparent; border: 0; color: #fff; font-size: 1.05rem;
  width: 2.2rem; height: 2.2rem; border-radius: 8px; cursor: pointer;
}
.present-controls button:hover { background: rgba(255, 255, 255, 0.15); }
body.presenting .navbar { display: none; }
body.presenting { padding-top: 0; }
html:has(body.presenting) { scroll-padding-top: 0; }
body.presenting .project { min-height: 100vh; }

/* ------------------------------------------------------------ responsive */
@media screen and (max-width: 768px) {
  .hero .publication-title { font-size: 2.4rem; }
  .hero-sub { font-size: 1.1rem; }
  .project { padding: 3rem 1rem; }
  .project .publication-title { font-size: 1.65rem; }
  .wall { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; }
  .wall-caption strong { font-size: 0.92rem; }
  #present-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wall-tile { transition: none; }
}

.team .button.is-medium { white-space: normal; height: auto; max-width: 100%; }
