/* Case-study layout (HyDroQuad, Launch Vehicle, Laser Propulsion, NASA L'SPACE,
   SUPARNA). Theme-token driven so it follows dark/light like the rest of the site. */
.hdq-case .page-hero { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.hdq-case .page-hero p:not(.eyebrow) { max-width: 62ch; }
.hdq-hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.hdq-case .section-inner > .hdq-metrics { margin-top: -2.6rem; }
.hdq-metrics {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--glass), var(--glass-2));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.7);
  backdrop-filter: blur(var(--blur)) saturate(1.7);
}
.hdq-metrics > div { display: flex; flex-direction: column-reverse; gap: 0.5rem; padding: 1.6rem 1.4rem; border-right: 1px solid var(--line); }
.hdq-metrics > div:last-child { border-right: 0; }
.hdq-metrics dt { color: var(--text-3); font-size: 0.8rem; }
.hdq-metrics dd { margin: 0; font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 650; line-height: 1.15; letter-spacing: -0.03em; }
.hdq-metrics dd span { color: var(--text-2); font-size: 0.5em; font-weight: 500; letter-spacing: 0; }

.hdq-case figure { min-width: 0; margin: 0; }
.hdq-case figure a { display: block; }
.hdq-case figure img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.hdq-case figcaption { margin-top: 0.8rem; color: var(--text-3); font-size: 0.85rem; line-height: 1.6; }

.hdq-assembly,
.hdq-wide-figure,
.hdq-test-grid figure,
.hdq-design-grid figure {
  padding: 0.6rem 0.6rem 0.2rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--glass), var(--glass-2));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
}
.hdq-case .hdq-assembly { max-width: 960px; margin: 2.4rem auto; }
.hdq-case .hdq-wide-figure { max-width: 1040px; margin: 2rem auto; }
.hdq-assembly figcaption, .hdq-wide-figure figcaption, .hdq-test-grid figcaption, .hdq-design-grid figcaption { padding: 0 0.5rem 0.8rem; }

.hdq-contents { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.4rem 0 0; }
.hdq-contents a {
  padding: 0.45rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: border-color 200ms ease, color 200ms ease, transform 300ms var(--ease);
}
.hdq-contents a:hover { border-color: rgba(255, 138, 43, 0.6); color: var(--text); transform: translateY(-1px); }
.hdq-case section[id] { scroll-margin-top: 100px; }

.hdq-split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 5vw, 4.5rem); }
.hdq-case h2 { margin: 0 0 1.2rem; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.12; }
.hdq-case h3 { margin: 0 0 1rem; font-size: 1.25rem; line-height: 1.3; }
.hdq-prose p { margin: 0 0 1.25rem; color: var(--text-2); font-size: 1.05rem; line-height: 1.85; }
.hdq-prose .hdq-credit, .hdq-note { color: var(--text-3); font-size: 0.86rem; line-height: 1.7; }

.hdq-design-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(2rem, 4vw, 3.5rem); margin-top: 2rem; align-items: start; }
.hdq-budget dl { margin: 0 0 1.5rem; }
.hdq-budget dl > div { display: flex; justify-content: space-between; gap: 1.2rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.hdq-budget dt { color: var(--text-2); }
.hdq-budget dd { margin: 0; font-weight: 650; }
.hdq-budget p { color: var(--text-3); font-size: 0.9rem; line-height: 1.7; }
.hdq-total, .hdq-total dt { color: var(--accent-ink); font-weight: 650; }

.hdq-table-wrap {
  margin-top: 2.2rem;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--glass), var(--glass-2));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
}
.hdq-case table { width: 100%; border-collapse: collapse; font-size: 0.92rem; text-align: left; }
.hdq-case caption { padding: 1rem 1.2rem; color: var(--text-3); font-size: 0.8rem; text-align: left; }
.hdq-case th, .hdq-case td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.hdq-case thead { background: var(--chip-bg); }
.hdq-case thead th { color: var(--accent-ink); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.hdq-case tbody th { width: 30%; font-weight: 600; }
.hdq-case tbody td { color: var(--text-2); }
.hdq-case tbody td:nth-child(2) { width: 18%; color: var(--text); font-weight: 650; white-space: nowrap; }
.hdq-case tbody tr:last-child th, .hdq-case tbody tr:last-child td { border-bottom: 0; }

.hdq-takeaway {
  max-width: 860px;
  margin-top: 2.4rem;
  padding: 1.3rem 1.6rem;
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, rgba(255, 138, 43, 0.1), transparent);
}
.hdq-takeaway p { margin: 0; color: var(--text-2); line-height: 1.8; }

.hdq-test-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(2rem, 5vw, 4rem); margin-top: 2.2rem; align-items: center; }
.hdq-test-grid figure { max-width: 340px; justify-self: end; }
.hdq-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem 1rem; margin: 1.4rem 0; font-size: 0.95rem; }
.hdq-bar { grid-column: 1 / -1; height: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--chip-bg); }
.hdq-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a5a78, #8fa2c0); }
.hdq-bar-measured span { background: linear-gradient(90deg, var(--orange-deep), var(--orange-2)); box-shadow: 0 0 16px rgba(255, 138, 43, 0.5); }

.hdq-paper { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; }
.hdq-paper > div { max-width: 740px; }
.hdq-paper .button { flex-shrink: 0; }

@media (max-width: 900px) {
  .hdq-split, .hdq-design-grid { gap: 2rem; }
  .hdq-split, .hdq-design-grid, .hdq-test-grid { grid-template-columns: 1fr; }
  .hdq-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hdq-metrics > div:nth-child(2) { border-right: 0; }
  .hdq-metrics > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .hdq-test-grid figure { justify-self: center; }
}

@media (max-width: 640px) {
  .hdq-case h2 { font-size: 1.7rem; }
  .hdq-metrics > div { padding: 1.2rem 0.9rem; }
  .hdq-metrics dt { font-size: 0.72rem; }
  .hdq-case th, .hdq-case td { padding: 0.75rem 0.6rem; font-size: 0.8rem; }
  .hdq-case tbody td:nth-child(2) { white-space: normal; }
  .hdq-paper { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
}
