/* ------------------------------------------------------------------
   GameVerse – Global Stylesheet
   Inspired by “The Matrix” reference site (neon / cyber aesthetic)
------------------------------------------------------------------- */

/* ------------ Fonts & Variables --------------------------------- */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300 700;
  font-stretch: 100%;
  font-display: block;
  src: url("../assets/fonts/roboto.woff2") format("woff2");
}

:root {
  /* theme palette */
  --bg-primary: #000;
  --bg-secondary: #0a0a0a;
  --bg-alt: #081018;
  --clr-text: #ffffff;
  --clr-muted: #9ba0a6;
  --clr-accent: #08fdd8;
  --clr-accent-soft: rgba(8, 253, 216, 0.15);
  /* layout */
  --max-width: 1500px;
  --section-padding: 60px;
  --radius-base: 8px;
  /* typography */
  --font-base: "Roboto", sans-serif;
  --fs-h1: clamp(2.5rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.5rem, 4vw, 2.5rem);
  --fs-body: 1rem;
  --fw-light: 300;
  --fw-reg: 400;
  --fw-bold: 600;
  /* transition */
  --easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.4s;
}

/* ------------ Resets -------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--clr-text);
  font-family: var(--font-base);
  line-height: 1.6;
  font-weight: var(--fw-reg);
}

/* ------------ Typography ---------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: var(--fw-light);
  margin: 0 0 0.4em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

p {
  margin: 0 0 1em;
  color: var(--clr-muted);
  font-size: var(--fs-body);
}

/* ------------ Layout Helpers ------------------------------------ */
.section {
  padding: var(--section-padding) 5%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: 0.4em;
}

.section-desc {
  font-size: 1.125rem;
  font-weight: var(--fw-light);
  color: var(--clr-muted);
  text-align: left;
  max-width: 900px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.75;
  padding-left: 1.5em;
}

/* ------------ Navigation ---------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid #111;
}

header .logo {
  display: flex;
  align-items: center;
  color: var(--clr-text);
  font-weight: var(--fw-bold);
  font-size: 1.25rem;
  text-decoration: none;
  gap: 8px;
}

header nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

header nav a {
  color: var(--clr-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--duration) var(--easing);
}

header nav a:hover,
header nav a.active {
  color: var(--clr-accent);
}

/* ------------ Top Dropdown Menu (Right Corner) --------------- */
.top-dropdown {
  position: static;
  display: flex;
  align-items: center;
  margin-left: 0;
  z-index: 120;
  height: 100%;
}

.dropdown-toggle {
  background: rgba(20, 20, 20, 0.55);
  border: none;
  border-radius: 10px;
  padding: 0 10px;
  color: var(--clr-muted);
  font-size: 1.08rem;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
  outline: none;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
}
.dropdown-toggle:hover, .dropdown-toggle:focus {
  color: var(--clr-accent);
  background: linear-gradient(90deg, rgba(8,253,216,0.10) 0%, rgba(8,253,216,0.18) 100%);
  box-shadow: 0 4px 16px 0 rgba(8,253,216,0.10);
  transform: scale(1.08);
}

/* 美化SVG汉堡图标 */
.hamburger-icon {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.10));
}
.hamburger-icon rect {
  transition: fill 0.18s;
  fill: currentColor;
  rx: 1.2;
}
.dropdown-toggle:hover .hamburger-icon,
.dropdown-toggle:focus .hamburger-icon {
  color: var(--clr-accent);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--clr-accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  padding: 12px 0;
  flex-direction: column;
  gap: 0;
  z-index: 130;
  animation: fadeUp 0.25s;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--clr-text);
  padding: 12px 24px;
  font-size: 1.08rem;
  text-decoration: none;
  background: none;
  border: none;
  transition: background 0.18s, color 0.18s;
  cursor: pointer;
}
.dropdown-item:hover {
  background: var(--clr-accent-soft);
  color: var(--clr-accent);
}

.dropdown-item .icon {
  font-size: 1em;
  display: inline-block;
  width: 1.5em;
  text-align: center;
}

/* ------------ Coming Soon Tag ------------------------------- */
.coming-soon {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 0.85em;
  color: #b6b6b6;
  background: rgba(200,200,200,0.10);
  border-radius: 8px;
  font-weight: 400;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* 适配移动端 */
@media (max-width: 640px) {
  .top-dropdown {
    margin-left: 8px;
  }
  .dropdown-menu {
    min-width: 140px;
    right: 0;
    top: 38px;
  }
}

/* ------------ Buttons ------------------------------------------- */
.button {
  position: relative;
  background: transparent;
  color: var(--clr-text);
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid var(--clr-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration) var(--easing),
              box-shadow var(--duration) var(--easing),
              transform var(--duration) var(--easing);
}

.button:hover {
  background: var(--clr-accent-soft);
  box-shadow: 0 0 8px var(--clr-accent), 0 0 24px var(--clr-accent-soft);
  transform: translateY(-2px);
}

/* ------------ Hero / Intro -------------------------------------- */
#intro {
  position: relative;
  height: 100vh;
  padding-top: 120px; /* header offset */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#intro h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  margin-bottom: 0.2em;
}

#intro h2 {
  font-weight: var(--fw-light);
  color: var(--clr-muted);
}

#intro h2 strong {
  color: var(--clr-text);
}

#intro .placeholder-wrap {
  margin-top: 40px;
}

/* ------------ Hero Matrix Rain (optional) ----------------------- */
#matrixRain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
}

/* ------------ Card Grid ----------------------------------------- */
.subcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  /* 强制每行最多3个，超出自动换行 */
}

.subcard {
  background: var(--bg-secondary);
  border: 1px solid #222;
  border-radius: var(--radius-base);
  padding: 6px;
  transition: transform var(--duration) var(--easing),
              box-shadow var(--duration) var(--easing);
}

.subcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.subcard video,
.placeholder-video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
  border: none;
  border-radius: 4px;
}

.placeholder-video {
  position: relative;
}

.placeholder-video::after {
  content: "Video coming soon";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-muted);
  font-style: italic;
}

.subcard-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
  color: var(--clr-muted);
}

/* ------------ Subsection Layout ------------------------------- */
.subsection {
  margin-bottom: 4rem;
}

.subsection-title {
  font-size: 1.375rem;
  font-weight: var(--fw-bold);
  text-align: center;
  color: var(--clr-text);
  margin-bottom: 1rem;
}

/* ------------ Contributors & BibTeX --------------------------- */
.acknowledgements-section,
.bibtex-section {
  padding: var(--section-padding) 5%;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.acknowledgements-section {
  background: var(--bg-secondary); /* match BibTeX style */
  border-top: 1px solid #111;
}

.bibtex-section {
  background: var(--bg-secondary);
  border-top: 1px solid #111;
}

.bibtex-code {
  background: #111;
  color: var(--clr-text);
  padding: 20px;
  border-radius: var(--radius-base);
  display: inline-block;
  text-align: left;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  max-width: 800px;
  overflow-x: auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

/* ------------ Fade-in Animation -------------------------------- */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-fade] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration) var(--easing),
              transform var(--duration) var(--easing);
}

[data-fade].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------ Utility ------------------------------------------ */
.hero-img {
  width: 100%;
  max-width: 650px;
  display: block;
  margin: 0 auto 2rem;
  border-radius: var(--radius-base);
}

/* 可为每个图片单独设置宽度：.hero-img--overview, .hero-img--simulation, .hero-img--generation, .hero-img--editing */
.hero-img--overview   { max-width: 900px !important; }
.hero-img--simulation { max-width: 700px !important; }
.hero-img--generation { max-width: 700px !important; }
.hero-img--editing    { max-width: 800px !important; }

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}

/* ---------- Logo Title (Yan) ----------------------------------- */
.logo-title {
  display: inline-flex;
  gap: 0;
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.logo-title span {
  display: inline-block;
  position: relative;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.logo-title .y,
.logo-title .n {
  background-image: repeating-linear-gradient(
    180deg,
    #9ee8ff 0%,
    #6dddff 20%,
    #9ee7ff 40%,
    #7ad9fc 60%,
    #9ed8ff 80%
  );
}

.logo-title .a {
  background-image: linear-gradient(180deg, #ff9652 0%, #ff7447 25%, #2fcefa 100%);
}
/* ---------- Demo Video ---------------------------------------- */
.demo-video {
  border: none !important;
  border-radius: var(--radius-base);
  box-shadow: none !important;
  cursor: pointer;
  transition: box-shadow var(--duration) var(--easing), transform var(--duration) var(--easing);
}
.demo-video:hover {
  box-shadow: 0 0 12px var(--clr-accent), 0 0 32px rgba(0, 255, 210, 0.2);
  transform: translateY(-2px);
}

/* ---------- Intro Background Video ------------------------------ */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.5);
}

/* ---------- Intro Content Container ----------------------------- */
.intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 90%;
  margin: 0 auto;
}

/* ---------- Scroll-down Icon ------------------------------------ */
.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--clr-accent);
  text-decoration: none;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -10px); }
  60% { transform: translate(-50%, -6px); }
}

/* ------------ Footer ------------------------------------------- */
footer {
  padding: 40px 5%;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--clr-muted);
  font-size: 0.9rem;
  border-top: 1px solid #111;
}

/* ------------ Responsive Tweaks -------------------------------- */
@media (max-width: 640px) {
  header nav ul {
    gap: 12px;
  }
  .section {
    padding-left: 6%;
    padding-right: 6%;
  }
}
