/* Float CanSat image right in project details */
.cansat-float-img {
  float: right;
  margin: 0 0 1em 2em;
  max-width: 420px;
  width: 48%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* EuRoC 2026: image inside the text box */
.project-card.euroc-2026 {
  padding-top: 16px;
}

.project-card.euroc-2026 h2 {
  margin-top: 0;
  margin-bottom: 6px;
}

.project-card.euroc-2026 .project-details {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: -12px;
}

.project-card.euroc-2026 .pilot-side-img {
  flex: 0 0 auto;
  width: 220px;
  max-width: 30%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-top: -6px;
}

.project-card.euroc-2026 .project-text {
  min-width: 0;
}

@media (max-width: 640px) {
  .cansat-float-img {
    float: none;
    display: block;
    width: 100%;
    max-width: 520px;
    margin: 0 0 1em 0;
  }

  .project-card.euroc-2026 .project-details {
    flex-direction: column;
    margin-top: -6px;
  }

  .project-card.euroc-2026 .pilot-side-img {
    width: 280px;
    max-width: 85%;
    align-self: flex-start;
  }
}
.pages {
  position: relative;
  min-height: 100vh;
  transition: opacity 0.12s ease;
}

.page {
  display: none;

  /* layout corect */
  position: relative;
  width: calc(100% - 320px);
  min-height: 100vh;
  margin: 0 160px;
  padding: 120px 0 40px;

  /* siguranță */
  overflow: visible;
}

/* Home: pull content closer to the top */
#home.page {
  padding-top: 80px;
}

.page.active {
  display: block;
}

/* Prevent initial flash of the default page when a hash targets another section */
html.nav-prep .pages {
  opacity: 0;
  visibility: hidden;
}

html.nav-ready .pages {
  opacity: 1;
  visibility: visible;
}

/* Team profiles layout */
.team-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 16px;
}
.team-container {
  display: grid;
  grid-template-columns: 1fr; /* stack groups vertically */
  gap: 24px;
  margin-top: 16px;
}

.team-group {
  background: rgba(0,0,0,0.35);
  padding: 20px;
  border-radius: 10px;
}
.team-group {
  background: rgba(0,0,0,0.35);
  padding: 36px;
  border-radius: 12px;
}

.team-group h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
}

.team-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.team-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.team-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.45);
}

.team-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 56px;
}
.team-card img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 180px;
}

.team-card .profile h3 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}

.team-card .profile .role {
  margin: 2px 0 6px 0;
  font-size: 12px;
  color: #ccc;
  letter-spacing: 0.8px;
}

.team-card .profile .bio {
  margin: 0;
  font-size: 12px;
  color: #ddd;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .team-container { grid-template-columns: 1fr; }
  .team-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .team-card .profile h3 {
    margin: 0;
    font-size: 17px;
    color: #fff;
  }

  .team-card .profile .role {
    margin: 5px 0 10px 0;
    font-size: 14px;
    color: #ccc;
    letter-spacing: 0.8px;
  }

  .team-card .profile .bio {
    margin: 0;
    font-size: 14px;
    color: #ddd;
    line-height: 1.5;
  }

  .team-card img { width: 64px; height: 64px; flex: 0 0 64px; }
  .team-card { padding: 12px; gap: 12px; }
}

/* Incoming starts off-screen right, rotated slightly */
.page.incoming {
  visibility: visible;
  pointer-events: none;
  opacity: 0;
  transform: translateX(110%) rotateY(-18deg);
  transform-origin: right center;
}

/* Outgoing moves left and rotates away */
.page.outgoing {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-30%) rotateY(14deg);
  transform-origin: left center;
}

/* Project cards use the same background as contact page text boxes */
.project-card {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 40px 48px 40px 52px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.45);
  margin: 1.8em 1.2em;
  max-width: 100%;
  color: #fff;
  position: relative;
}

/* Normalize project images placement */
.project-card:hover {
  box-shadow: 0 24px 48px rgba(0,0,0,0.55);
  transform: translateY(-4px) scale(1.01);
}

/* Read-more clamp */
.project-card .project-content {
  position: relative;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.project-card.collapsible .project-content {
  max-height: none;
}

.project-card.collapsible.collapsed .project-content {
  max-height: 220px;
}

.project-card.collapsible.collapsed .project-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.read-more-btn {
  display: inline;
  margin-left: 6px;
  padding: 0;
  background: transparent;
  color: #e63946;
  border: none;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.4px;
  transition: color 0.2s ease;
  vertical-align: baseline;
}

.read-more-btn:hover {
  color: #457b9d;
}

/* Manual cut handling */
.readmore-extra {
  display: block;
}

.project-card.collapsible.collapsed .readmore-extra {
  display: none;
}

/* Technical documents layout */
.tech-docs-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
  max-width: 900px;
}

.tech-docs {
  display: block;
  width: 100%;
  text-align: left;
}

.tech-doc-heading {
  margin: 0 0 14px 0;
  font-size: 22px;
  letter-spacing: 0.6px;
  color: #fff;
}

.tech-doc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.tech-doc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px;
  min-height: 150px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.45);
}

.tech-doc-meta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-align: left;
}

.doc-badge {
  padding: 4px 10px;
  border-radius: 6px;
  background: #457b9d;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.tech-doc-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

@media (max-width: 1100px) {
  .tech-doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .tech-doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .tech-doc-grid {
    grid-template-columns: 1fr;
  }
}

.doc-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #457b9d;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.35);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.doc-btn:hover {
  background: #2e5266;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0,0,0,0.4);
}

@media (max-width: 900px) {
  .page {
    width: 100%;
    margin: 0;
    padding: 88px 16px 32px;
  }

  .project-card {
    padding: 24px 20px;
    margin: 1.2em 0;
  }

  .team-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }

  .team-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    gap: 14px;
  }

  .team-card img {
    width: 140px;
    height: 140px;
    flex: 0 0 auto;
  }

  .team-card .profile {
    text-align: center;
  }
}

@media (max-width: 900px) {
  .tech-doc-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .tech-buttons-row {
    flex-direction: column;
    align-items: center;
  }

  .tech-btn {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }
}
