:root {
  --nu-purple: #4e2a84;
  --nu-lavender: #836eaa;
  --ink: #17151d;
  --ink-soft: #3f3a4a;
  --paper: #ffffff;
  --paper-alt: #f7f5fb;
  --line: #d8d2e4;
  --card: #fcfbff;
  --shadow: 0 14px 30px rgba(50, 34, 77, 0.08);
  --radius: 14px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0% 0%, rgba(78, 42, 132, 0.08), transparent 42%),
              radial-gradient(circle at 100% 15%, rgba(131, 110, 170, 0.1), transparent 30%),
              var(--paper);
  line-height: 1.6;
}

p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.hero-main {
  background: linear-gradient(130deg, #ffffff 0%, #f4f0fb 78%);
  border-bottom: 1px solid var(--line);
}

.hero-main .hero-body {
  padding: 4.5rem 1.25rem 3.2rem;
}

.kicker {
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--nu-purple);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.project-title {
  font-family: "Newsreader", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.project-subtitle {
  max-width: 850px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.project-authors {
  color: var(--nu-purple);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0.25rem 0 0.6rem;
}

.banner-section {
  padding-top: 0.9rem;
}

.banner-video {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #c8bddb;
  box-shadow: var(--shadow);
  background: #000;
}

.section {
  padding: 3.2rem 1.25rem;
}

.section-alt {
  background: linear-gradient(180deg, rgba(247, 245, 251, 0.95), rgba(255, 255, 255, 0.95));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-family: "Newsreader", serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 1.2rem;
  color: var(--ink);
}

.subsection-title {
  font-size: 1.35rem;
  color: var(--nu-purple);
  margin: 1.8rem 0 0.8rem;
  font-weight: 700;
}

.mini-title {
  font-size: 1rem;
  color: var(--nu-purple);
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.feature-list {
  margin: 0.6rem 0 1rem;
  padding-left: 1.4rem;
  list-style-type: disc;
  list-style-position: outside;
}

.feature-list li {
  display: list-item;
  margin-bottom: 0.52rem;
  color: var(--ink-soft);
}

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

.spec-table,
.motor-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper);
}

.table th,
.table thead th {
  background: var(--nu-purple);
  color: #fff !important;
  font-weight: 600;
}

.table td {
  color: #2f2a3a;
}

.carousel {
  margin: 1.2rem 0 1.4rem;
}

.carousel .item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.carousel .item img,
.carousel .item video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}

.carousel .item .caption {
  min-height: 2.7em;
}

.single-media {
  margin: 1.3rem 0;
}

.single-media img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.caption,
figcaption {
  color: #5a5368;
  margin-top: 0.55rem;
  font-size: 0.92rem;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.encoder-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-grid figure {
  margin: 0;
}

.media-grid img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lissajous-figure {
  width: 100%;
  max-width: 512px;
  justify-self: center;
}

.test-grid {
  grid-template-columns: 1fr;
}

.detail-video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #000;
}

.repo-link-wrap {
  margin-top: 1.1rem;
  font-weight: 600;
}

.repo-link-wrap a {
  color: var(--nu-purple);
  text-decoration: none;
}

.repo-link-wrap a:hover {
  text-decoration: underline;
}

.team-photo img {
  max-height: 560px;
  object-fit: cover;
}

.footer {
  background: #1f1a2b;
  color: #efeaf8;
  padding: 2rem 1rem;
}

.footer p {
  color: #fff;
}

.scroll-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--nu-purple);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 40;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  background: #3f226d;
}

@media (max-width: 900px) {
  .test-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 2.4rem 1rem;
  }

  .hero-main .hero-body {
    padding: 3.4rem 1rem 2.2rem;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}



