/* =====================================================
   HARDWARE PHOTO GALLERY
   ===================================================== */

.hardware-gallery {
  width: min(1100px, 92%);
  margin: 2rem auto 5rem;
}

#hardwareCarousel {
  overflow: hidden;
  border-radius: 1.5rem;
  background: var(--blue);
}

#hardwareCarousel .carousel-item {
  height: min(70vh, 650px);
}

#hardwareCarousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark gradient keeps captions readable over photographs. */
#hardwareCarousel .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      var(--blue),
      transparent 55%
    );
  pointer-events: none;
}

#hardwareCarousel .carousel-caption {
  z-index: 1;
  right: 10%;
  bottom: 2.5rem;
  left: 10%;
  text-align: left;
}

#hardwareCarousel .carousel-caption h3 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 3rem);
}

#hardwareCarousel .carousel-caption p {
  max-width: 700px;
  color: var(--white);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

@media (max-width: 600px) {
  #hardwareCarousel .carousel-item {
    height: 430px;
  }

  #hardwareCarousel .carousel-caption {
    bottom: 1.5rem;
  }
}

/* =====================================================
   PROJECT SPECIFICATIONS
   ===================================================== */

#project-specification {
  margin-block: 5rem;
  scroll-margin-top: 7rem;
}

/* Section heading */
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-number {
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.section-label {
  margin: 0 0 0.25rem;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  color: var(--white);
}

.section-introduction {
  max-width: 760px;
  margin-bottom: 2rem;
  color: var(--white);
  line-height: 1.7;
}

/* Table container */
.specification-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--blue);
  border-radius: 1.25rem;
  background:
    linear-gradient(
      145deg,
      var(--blue),
      var(--blue) 0.5rem,
      transparent 0.5rem,
      transparent 100%
    );
  box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.22);
}

/* Main table */
.specification-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--white);
}

/* Column headings */
.specification-table thead {
  background: rgba(5, 17, 32, 0.52);
}

.specification-table thead th {
  padding: 1.25rem 1.5rem;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: left;
  text-transform: uppercase;
}

/* Table rows */
.specification-table tbody tr {
  border-top: 1px solid var(--blue);
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.specification-table tbody tr:hover {
  background: var(--blue);
}

/* Criterion column */
.specification-table tbody th {
  width: 34%;
  padding: 1.4rem 1.5rem;
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  vertical-align: top;
}

/* Requirement column */
.specification-table td {
  padding: 1.4rem 1.5rem;
  vertical-align: top;
}

/* Important numerical requirement */
.specification-value {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  background: var(--background-color);
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Supporting explanation */
.specification-description {
  display: block;
  max-width: 620px;
  color: var(--white);
  line-height: 1.55;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  #project-specification {
    margin-block: 3.5rem;
  }

  .specification-table thead th,
  .specification-table tbody th,
  .specification-table td {
    padding: 1rem;
  }
}

/* =====================================================
   BUDGET TABLE
   Extends the project specification table styles.
   ===================================================== */

#budget {
  margin-block: 5rem;
  scroll-margin-top: 7rem;
}

/* Give the component column more space. */
.budget-table tbody th {
  width: auto;
}

/* Quantity and price alignment */
.budget-table .quantity-column {
  width: 15%;
  text-align: center;
  white-space: nowrap;
}

.budget-table .price-column {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}

.currency-label {
  display: block;
  margin-top: 0.2rem;
  color: var(--white);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

/* Category separators */
.budget-table .budget-category {
  background: var(--blue);
}

.budget-table .budget-category:hover {
  background: rgba(168, 221, 205, 0.07);
}

.budget-table .budget-category th {
  padding: 0.7rem 1.5rem;
  color: var(--white);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Placeholder values */
.budget-table td {
  color: var(--white);
}

.budget-table td:has(.total-value) {
  color: inherit;
}

/* Final cost row */
.budget-table tfoot {
  border-top: 1px solid var(--yellow);
  background: var(--background-color);
}

.budget-table .budget-total th,
.budget-table .budget-total td {
  padding: 1.35rem 1.5rem;
}

.budget-table .budget-total th {
  color: var(--white);
  text-align: right;
}

.total-value {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  background: var(--background-color);
  color: var(--yellow);
  font-weight: 700;
}

/* Small-screen adjustments */
@media (max-width: 767px) {
  #budget {
    margin-block: 3.5rem;
  }

  .budget-table {
    min-width: 760px;
  }
}

/* ==========================================================
   MANUFACTURING SECTION
========================================================== */

.manufacturing-section {
  padding-block: 5rem;
}

.manufacturing-section .section-introduction {
  max-width: 780px;
  margin: 0 0 4rem;
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* One manufacturing method/category */
.manufacturing-category {
  margin-top: 4rem;
}

/* Heading above each group of parts */
.manufacturing-category-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.category-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--yellow);
  border-radius: 50%;
  color: #b3efd6;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.category-label {
  margin: 0 0 0.25rem;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.manufacturing-category-heading h3 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

/* Responsive grid containing the component cards */
.manufacturing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1.5rem;
}

/* Individual component */
.manufacturing-card {
  overflow: hidden;
  border: 1px solid var(--blue);
  border-radius: 1.25rem;
  background: var(--background-color);
  box-shadow: 0 1rem 2.5rem var(--background-color);
  transition:
    transform 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease;
}

.manufacturing-card:hover,
.manufacturing-card:focus-within {
  transform: translateY(-0.5rem);
  border-color: var(--yellow);
  box-shadow: 0 1.4rem 3rem var(--background-color);
}

/* Photograph or render at the top of the card */
.component-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at top right, var(--blue), transparent 55%),
    var(--background-color);
}

.component-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition:
    transform 450ms ease,
    filter 450ms ease;
}

.manufacturing-card:hover .component-preview img,
.manufacturing-card:focus-within .component-preview img {
  transform: scale(1.07);
  filter: brightness(0.65);
}

/* Label revealed over the image */
.preview-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(6, 18, 34, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 250ms ease;
}

.manufacturing-card:hover .preview-overlay,
.manufacturing-card:focus-within .preview-overlay {
  opacity: 1;
}

/* Text below the component preview */
.component-information {
  padding: 1.4rem;
}

.component-number {
  margin: 0 0 0.5rem;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.component-information h4 {
  margin: 0 0 1.25rem;
  color: var(--white);
  font-size: 1.2rem;
}

.component-properties {
  margin: 0 0 1.4rem;
}

.component-properties div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--blue);
}

.component-properties dt {
  color: var(--white);
}

.component-properties dd {
  margin: 0;
  color: var(--white);
  text-align: right;
}

/* STL/DXF download button */
.manufacturing-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition:
    color 200ms ease,
    background-color 200ms ease,
    transform 200ms ease;
}

.manufacturing-download:hover,
.manufacturing-download:focus-visible {
  color: var(--background-color);
  background: var(--white);
  transform: translateY(-2px);
  outline: none;
}

/* Tablet and phone adjustments */
@media (max-width: 600px) {
  .manufacturing-section {
    padding-block: 3.5rem;
  }

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

  .manufacturing-category {
    margin-top: 3rem;
  }
}

/* Respect visitors who disable animations */
@media (prefers-reduced-motion: reduce) {
  .manufacturing-card,
  .component-preview img,
  .preview-overlay,
  .manufacturing-download {
    transition: none;
  }
}
/* =====================================================
   REDESIGN: overview, dropdowns, charts, cards, steps
   Flat colours only: the project's blue, yellow, orange.
   ===================================================== */

/* ---- Text ---- */
.hw-lead {
  max-width: 820px;
  color: var(--white);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.5;
}

.hw-bridge {
  margin-top: 2rem;
}

.hw-subtitle {
  margin: 1.5rem 0 0.75rem;
  color: var(--yellow);
  font-size: 1.05rem;
  font-weight: 700;
}

.hw-detail > .hw-subtitle:first-child {
  margin-top: 0;
}

/* ---- Dropdowns ---- */
/* Use the same shared text-button style as the concept page. */
.hw-more {
  margin-top: 1.5rem;
}

.hw-more:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

.hw-detail {
  padding: 1.5rem 0.25rem 0.5rem;
  overflow-wrap: anywhere;
}

.hw-detail .specification-table-wrapper {
  margin-bottom: 1.5rem;
}

/* ---- Figures and charts ---- */
.hw-figure {
  margin: 2rem 0;
}

.hw-figure figcaption {
  margin-top: 0.9rem;
  color: var(--white);
  font-size: 0.85rem;
  line-height: 1.6;
}

.hw-chart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--blue);
  border-radius: 1.25rem;
  background: var(--background-color);
}

.hw-chart text {
  fill: var(--white);
  font-family: inherit;
  font-size: 13px;
}

.hw-chart .hw-tick {
  font-size: 12px;
}

.hw-chart .hw-axis-title {
  font-size: 14px;
  font-weight: 700;
}

.hw-chart .hw-axis-title.hw-t { fill: var(--yellow); }
.hw-chart .hw-axis-title.hw-p { fill: var(--orange); }

.hw-grid,
.hw-axis {
  stroke: var(--blue);
  stroke-width: 1;
}

.hw-frame {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
}

.hw-band {
  fill: var(--yellow);
  opacity: 0.1;
}

.hw-limit {
  stroke: var(--yellow);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
}

.hw-chart .hw-band-label {
  fill: var(--yellow);
  font-size: 12.5px;
  font-weight: 700;
}

.hw-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hw-line-t { stroke: var(--yellow); }
.hw-line-p { stroke: var(--orange); }

.hw-pt {
  fill: var(--background-color);
  stroke-width: 2;
}

.hw-pt-t { stroke: var(--yellow); }
.hw-pt-p { stroke: var(--orange); }

.hw-crosshair {
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.hw-crosshair.is-visible {
  opacity: 1;
}

.hw-crosshair line {
  stroke: var(--white);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.hw-dot-temp { fill: var(--yellow); stroke: var(--background-color); stroke-width: 2; }
.hw-dot-press { fill: var(--orange); stroke: var(--background-color); stroke-width: 2; }

.hw-hit {
  fill: transparent;
  cursor: crosshair;
}

.hw-readout {
  min-height: 1.7em;
  margin: 0.9rem 0 0;
  color: var(--white);
  font-size: 0.95rem;
  text-align: center;
}

.hw-readout .hw-r-t { color: var(--yellow); font-weight: 700; }
.hw-readout .hw-r-p { color: var(--orange); font-weight: 700; }

/* Layers diagram */
.hw-layer-strato { fill: var(--blue); opacity: 0.6; }
.hw-layer-tropo { fill: var(--blue); }

.hw-chart .hw-layer-name {
  font-size: 18px;
  font-weight: 700;
}

.hw-chart .hw-layer-sub {
  font-size: 13px;
}

.hw-tropopause {
  stroke: var(--white);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}

.hw-bracket {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2.5;
}

.hw-chart .hw-bracket-label {
  fill: var(--yellow);
  font-size: 14px;
  font-weight: 700;
}

.hw-chart .hw-bracket-label.hw-big {
  font-size: 26px;
}

/* ---- Cards ---- */
.hw-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.hw-fact-card {
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--background-color);
  border: 1px solid var(--blue);
}

.hw-fact-label {
  margin: 0 0 0.5rem;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hw-fact-card h3 {
  margin: 0 0 1rem;
  color: var(--white);
  font-size: 1.4rem;
}

.hw-fact-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--white);
  font-size: 0.92rem;
  line-height: 1.65;
}

.hw-fact-card li + li {
  margin-top: 0.5rem;
}

/* Requirements at a glance */
.hw-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.hw-req {
  padding: 1.1rem 1.25rem;
  border-radius: 1.1rem;
  background: var(--background-color);
  border: 1px solid var(--blue);
}

.hw-req strong {
  display: block;
  color: var(--yellow);
  font-size: 1.35rem;
  line-height: 1.25;
}

.hw-req span {
  display: block;
  margin-top: 0.35rem;
  color: var(--white);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* RoDS: how it works */
.hw-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.hw-flow li {
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: var(--background-color);
  border: 1px solid var(--blue);
}

.hw-flow-number,
.hw-step-number {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 700;
}

.hw-flow h4 {
  margin: 0.9rem 0 0.4rem;
  color: var(--white);
  font-size: 1.15rem;
}

.hw-flow p {
  margin: 0;
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Components */
.hw-groups {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0 2.5rem;
}

.hw-group h4 {
  margin: 0 0 0.6rem;
  color: var(--yellow);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hw-chips li {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--background-color);
  color: var(--white);
  font-size: 0.88rem;
}

/* Assembly steps */
.hw-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.hw-step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: var(--background-color);
  border: 1px solid var(--blue);
}

.hw-step h4 {
  margin: 0 0 0.35rem;
  color: var(--white);
  font-size: 1.05rem;
}

.hw-step p {
  margin: 0;
  color: var(--white);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Placeholders (animation, schematic, code) */
.hw-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 240px;
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--background-color);
  color: var(--white);
  text-align: center;
  border: 1px solid var(--blue);
}

.hw-placeholder p {
  margin: 0;
  font-weight: 700;
}

.hw-placeholder small {
  opacity: 0.75;
}

/* References */
.hardware-references {
  overflow-wrap: anywhere;
}

.hardware-references a {
  color: var(--yellow);
  text-underline-offset: 4px;
}

.hardware-references li + li {
  margin-top: 0.4rem;
}

.hardware-references li p {
  margin-bottom: 0;
}

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .hw-facts {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 600px) {
  .hw-flow,
  .hw-steps {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw-crosshair {
    transition: none;
  }
}

/* Use the shared highlight box without its yellow accent. */
.hardware-launch-note {
  border-left-width: 1px;
  border-left-color: #5C7098;
}

/* Center standalone photographs and align images within comparison rows. */
.toc-section figure.figure > img {
  display: block;
  margin-inline: auto;
}

#how-did-we-meet-the-specifications .row figure.figure > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* Compact manufacturing cards, grouped by material. */
#manufacturing .manufacturing-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 0.85rem;
}

#manufacturing .manufacturing-category {
  margin-top: 2rem;
}

#manufacturing .manufacturing-card {
  border-radius: 0.75rem;
}

#manufacturing .component-preview {
  height: 110px;
  aspect-ratio: auto;
}

#manufacturing .component-preview img {
  object-fit: contain;
}

#manufacturing .component-information {
  padding: 0.75rem;
}

#manufacturing .component-information h4 {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

#manufacturing .manufacturing-download {
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

/* Expanded firmware directory: folders stay visible and PDFs open separately. */
.hardware-code-tree,
.hardware-code-tree ul {
  list-style: none;
}
.hardware-code-tree {
  padding-left: 0;
  margin: 1.5rem 0;
}
.hardware-code-tree ul {
  margin: 0.5rem 0 1rem 0.3rem;
  padding-left: clamp(0.8rem, 2vw, 1.5rem);
  border-left: 1px solid var(--blue);
}
.hardware-code-tree li {
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}
.hardware-code-folder-name {
  color: var(--blue-light);
  font-weight: 700;
}
.hardware-code-tree a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

/* Atmospheric density graphs. */
.hw-atmosphere-graphs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; margin: 2rem 0; }
.hw-atmosphere-graphs figure { min-width: 0; }
@media (max-width: 575.98px) { .hw-atmosphere-graphs { grid-template-columns: 1fr; } }
