/* =========================================================
   VEX ROBOTICS PROJECT PAGE
========================================================= */


/* adds consistent paragraph spacing on the VEX page */
.robotics-page section p {
  margin-bottom: 18px;
}


/* lets the project intro run slightly wider */
.robotics-page .section-desc {
  max-width: 820px;
}


/* makes the project hero a little smaller than the homepage hero */
.robotics-page .hero {
  padding: 72px 0;
}


/* stops the title from stretching too far */
.robotics-page .hero h1 {
  max-width: 900px;
}


/* School, class, and semester line under the title */
.robotics-page .project-school {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 22px;
}


/* =========================================================
   PROJECT OVERVIEW
========================================================= */


/* Four quick facts about the project */
.project-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
}


/* Individual fact card */
.project-fact {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}


/* Small label like TEAM or PLATFORM */
.project-fact h3 {
  margin-bottom: 7px;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* Main value inside each fact card */
.project-fact p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}


/* =========================================================
   ROBOT BUILD VERSIONS
========================================================= */


/* One robot version - earlier or final */
.build-version {
  margin-top: 52px;
}


.build-version + .build-version {
  margin-top: 72px;
}


/* Number and title above each robot version */
.build-version-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}


/* Small green numbers used throughout the project page */
.build-label,
.contribution-number {
  display: inline-block;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}


/* Robot version title */
.build-version-header h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.35rem;
}


/* Short description under the robot version title */
.build-version-header p {
  margin: 0;
  color: var(--muted);
}


/* Shows two different angles of each robot build */
.build-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  align-items: start;
}


/*
   shows the full photo without cropping it.
*/
.build-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}


/* =========================================================
   MY CONTRIBUTION
========================================================= */


/* Explanation on the left and code on the right */
.contribution-block {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 55px;
  align-items: start;

  margin-top: 55px;
  padding-bottom: 55px;

  border-bottom: 1px solid var(--border);
}


/* Small alignment tweak for the contribution text */
.contribution-copy {
  padding-top: 4px;
}


/* Contribution title */
.contribution-copy h3 {
  margin: 7px 0 14px;
  color: var(--text);
  font-size: 1.45rem;
}


/* contribution explanation */
.contribution-copy p {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.75;
}


/* =========================================================
   CODE EXAMPLES
========================================================= */


/* dark box around each code snippet */
.code-window {
  overflow: hidden;

  background: #17211a;

  border: 1px solid #2b3a2e;
  border-radius: 16px;

  box-shadow: 0 14px 32px rgba(30, 50, 35, 0.14);
}


/* Small filename bar above the code */
.code-header {
  padding: 11px 18px;
  background: #223027;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #b9c9bc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
}

/* Gives the code some room inside the box */
.code-window pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  background: transparent;
}

/* Actual code text */
.code-window code {
  color: #edf6ef;

  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.75;

  white-space: pre;
}

/* =========================================================
   AUTONOMOUS SEQUENCE
========================================================= */

/* Wrapper around the six autonomous steps */
.autonomous-sequence {
  margin-top: 55px;
}

/* autonomous sequence title */
.autonomous-sequence h3 {
  margin-bottom: 18px;
  font-size: 1.3rem;
}

/* Puts all six steps in one row on desktop */
.sequence-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);

  overflow: hidden;

  background: var(--white);

  border: 1px solid var(--border);
  border-radius: 16px;

  box-shadow: var(--shadow);
}

/* each autonomous step */
.sequence-steps div {
  min-height: 105px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  padding: 18px 10px;

  text-align: center;

  border-right: 1px solid var(--border);
}

/* last step does not need a divider */
.sequence-steps div:last-child {
  border-right: none;
}

/* step number */
.sequence-steps strong {
  margin-bottom: 7px;

  color: var(--primary-dark);

  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

/* step description */
.sequence-steps span {
  color: var(--text);

  font-size: 0.87rem;
  font-weight: 600;
}

/* =========================================================
   AUTONOMOUS DEMO
========================================================= */

.autonomous-demo {
  margin-top: 72px;
}

/* number and title above the video */
.demo-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;

  margin-bottom: 22px;
}

/* Autonomous demo title */
.demo-heading h3 {
  margin: 4px 0 5px;
  font-size: 1.4rem;
}

/* Autonomous demo desc */
.demo-heading p {
  margin: 0;
  color: var(--muted);
}

/* Landscape autonomous video */
.autonomous-demo video {
  display: block;

  width: 100%;
  max-width: 920px;

  margin: 0 auto;

  background: #111;

  border: 1px solid var(--border);
  border-radius: 18px;

  box-shadow: var(--shadow);
}

/* =========================================================
   SENSOR DEVELOPMENT
========================================================= */

/* Vertical sensor video beside the explanation */
.sensor-demo {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 55px;

  align-items: center;

  max-width: 920px;

  margin: 80px auto 0;
}

.sensor-video {
  width: 100%;
  max-width: 320px;
}

/*
   Sensor clip uses a vertical 9:16 frame.
*/
.sensor-video video {
  display: block;

  width: 100%;
  aspect-ratio: 9 / 16;

  object-fit: cover;

  background: transparent;

  border: 1px solid var(--border);
  border-radius: 18px;

  box-shadow: var(--shadow);
}

/* Sensor section title */
.sensor-copy h3 {
  margin: 7px 0 14px;
  font-size: 1.45rem;
}

/* Sensor explanation */
.sensor-copy p {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.75;
}

/* =========================================================
   WHAT I LEARNED
========================================================= */

.robotics-page .section-dark:last-of-type .container > p {
  max-width: 900px;
}


/* =========================================================
   VEX MOBILE LAYOUT
========================================================= */

@media (max-width: 760px) {

  .robotics-page section {
    padding: 64px 0;
  }

  .robotics-page .nav-inner {
    align-items: center;
    justify-content: space-between;
  }

  .robotics-page .brand {
    font-size: 1rem;
    max-width: none;
    white-space: nowrap;
  }

  .robotics-page .nav-links {
    display: flex;
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-direction: row;
  }

  .robotics-page .nav-links a {
    width: auto;
    padding: 0;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .project-facts {
    grid-template-columns: 1fr;
  }

  .build-gallery {
    grid-template-columns: 1fr;
  }

  .build-gallery img {
    width: 100%;
    height: auto;
  }

  .build-version + .build-version {
    margin-top: 55px;
  }

  .contribution-block {
    margin-top: 45px;
    padding-bottom: 45px;
  }

  .code-window pre {
    padding: 18px;
  }

  .code-window code {
    font-size: 0.78rem;
  }

  .sequence-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dividers between the mobile steps */
  .sequence-steps div {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  /* Removes the divider from the right side of each row */
  .sequence-steps div:nth-child(even) {
    border-right: none;
  }

  .sequence-steps div:nth-last-child(-n + 2) {
    border-bottom: none;
  }

  .autonomous-demo {
    margin-top: 55px;
  }

  /* Sensor video and explanation stack on phones */
  .sensor-demo {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 28px;
    margin-top: 60px;
  }

  /* Keeps the vertical sensor clip at a reasonable size */
  .sensor-video {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}