/* ===============================
   BASE STYLES
=============================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: Georgia, serif;
  background-color: black;
  color: beige;
  margin-top: 120px;
}

section { scroll-margin-top: 130px; }

.section-divider {
  border: none;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, goldenrod 25%, maroon 75%, transparent 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  width: 100%;
  margin: 60px auto;
  border-radius: 2px;
}

/* ===============================
   PROJECT DETAIL LAYOUT WRAPPER
=============================== */
.project-detail {
  padding: 10px 20px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===============================
   PROJECT HEADER - FLEX LAYOUT
=============================== */
.project-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  margin: 30px auto 24px;
  padding: 28px;
  border: 5px solid goldenrod;
  border-radius: 12px;
  max-width: 1000px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.project-header-text {
  flex: 1 1 52%;
  text-align: center;
  min-width: 280px;
}

.project-header-text h1 {
  color: maroon;
  margin: 0 0 .5rem 0;
  font-size: 50px;
  line-height: 1.15;
}

.project-header-text p {
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0.25rem 0 0.75rem;
}

.github-button-wrapper {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.github-button {
  background-color: goldenrod;
  color: maroon;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  min-width: 160px;
  text-align: center;
  border: 2px solid transparent;
  transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.github-button:hover {
  background-color: maroon;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.22);
}
.github-button .icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

.project-banner {
  flex: 1 1 40%;
  max-width: 480px;
  height: 260px;
  border-radius: 10px;
  border: 3px solid maroon;
  object-fit: cover;
  background: #000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

/* ===============================
   NAVIGATION SECTION BOX (anchor chips)
=============================== */
.nav-section-box {
  max-width: 1000px;
  padding: 18px;
  border-radius: 10px;
  margin: 0 auto 26px auto;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

.project-button {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-button a {
  color: goldenrod;
  background-color: maroon;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.project-button a:hover {
  background-color: goldenrod;
  color: maroon;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,.18);
}

/* ===============================
   PROJECT SECTION BOXES
=============================== */
.project-section-content {
  max-width: 1000px;
  padding: 18px;
  border-radius: 10px;
  margin: 0 auto 26px auto;
  border: 5px solid goldenrod;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.project-section-box {
  padding: 20px 22px;
  max-width: 900px;
  margin: 0 auto 26px auto;
  border-radius: 10px;
  color: white;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
}

.project-section-box h2 {
  margin: 0 0 10px 0;
  color: maroon;
  font-size: 30px;
}

.project-section-box h3 {
  margin: 0 0 10px 0;
  color: goldenrod;
  font-size: 30px;
}

.project-section-box h4 {
  margin: 14px 0 8px;
  color: #7a1e1e;
  font-size: 20px;
}

.project-section-box h5 {
  margin: 14px 0 8px;
  color: #FFD052;
  font-size: 20px;
}

.project-section-box p {
  margin: 8px 0 14px;
  line-height: 1.7;
}

.project-section-box ul {
  padding-left: 20px;
  margin: 8px 0 6px;
}
.project-section-box ul li {
  margin-bottom: 6px;
}

/* ===============================
   GENERAL SECTION / BACK LINK
=============================== */
.back-link {
  text-align: center;
  margin-top: 40px;
}

.back-link a {
  color: goldenrod;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
}
.back-link a:hover {
  color: maroon;
  transform: translateY(-1px);
}

/* ===============================
   BACK TO TOP BUTTON
=============================== */
#backToTop {
  display: none;
  position: fixed;
  bottom: 40px;
  right: 30px;
  z-index: 999;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: beige;
  color: goldenrod;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.25);
  transition: opacity .3s ease, transform .3s ease;
}
#backToTop:hover { background-color: #555; color: #fff; }
#backToTop ion-icon { font-size: 24px; vertical-align: middle; }

/* ===============================
   REDUCED MOTION
=============================== */
@media (prefers-reduced-motion: reduce){
  .github-button,
  .project-button a,
  .back-link a,
  #backToTop {
    transition: none !important;
  }
}

/* ===============================
   MEDIA QUERIES
=============================== */
@media (max-width: 1024px){
  .project-header {
    flex-direction: column;
    text-align: center;
  }
  .project-header-text { text-align: center; }
  .github-button-wrapper { justify-content: center; }

  .project-banner {
    width: 100%;
    height: auto;          /* let video choose height proportionally */
    max-width: 100%;
  }
}

@media (max-width: 600px){
  .project-header { padding: 22px; }
  .project-section-box { padding: 18px; }
  .project-header-text h1 { font-size: 1.9rem; }
  .project-banner { max-width: 100%; }
}