/* ==========================================================================
   /fpga-autoresearch — page-specific styles.
   Typography, colors, and base come from ../personal_assets/main.css
   (Roboto, white background, #333 text, #477dca links, Bootstrap 3).
   Note: Bootstrap sets html { font-size: 10px }, so 1.6rem = 16px.
   AER accent: amber #F5B04E (tint #FFF8EA, dark #9A6E1B for text on white).
   ========================================================================== */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.aer-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.aer-wrap p, .aer-wrap ul { text-align: left; }

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

h3 { margin-top: 90px; }

.section-lede {
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

/* ---------------- sticky nav ---------------- */

.aer-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e8e8e8;
}

.aer-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.1rem 20px;
  display: flex;
  align-items: center;
  gap: 2.4rem;
}

.aer-mark {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #333;
  text-decoration: none;
}
.aer-mark:hover, .aer-mark:focus { color: #333; text-decoration: none; }
.aer-mark .mark-dot { color: #F5B04E; }

.aer-nav-links {
  display: flex;
  gap: 2.2rem;
  margin-left: auto;
}
.aer-nav-links a {
  font-size: 1.4rem;
  color: #666;
  text-decoration: none;
}
.aer-nav-links a:hover { color: #477dca; }

.nav-cta {
  font-size: 1.4rem;
  font-weight: 500;
  color: #fff !important;
  background: #477dca;
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-cta:hover { background: #3964a2; }

@media screen and (max-width: 760px) {
  .aer-nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

/* ---------------- form-first top block ---------------- */

.pilot-top {
  background: #f7f9fc;
  border-bottom: 3px solid #F5B04E;
  padding: 5rem 0 6rem;
  text-align: center;
}

.eyebrow {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9A6E1B;
  margin-bottom: 1.6rem;
}

.pilot-top h1 {
  font-size: 4rem;
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 1.4rem;
}

.pilot-lede {
  font-size: 1.7rem;
  font-weight: 300;
  color: #444;
  max-width: 680px;
  margin: 0 auto 1.4rem;
  text-align: center !important;
}
.pilot-lede b { font-weight: 500; color: #333; }

.footnote {
  font-size: 1.3rem;
  color: #888;
  margin: 0 auto 3.5rem;
  text-align: center !important;
}

figcaption {
  font-size: 1.3rem;
  color: #999;
  margin-top: 1rem;
  text-align: center;
}

/* ---------------- stat + constraint tiles ---------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  margin: 3.5rem 0 1rem;
}
.tile {
  border: 1px solid #e8e8e8;
  border-top: 3px solid #F5B04E;
  border-radius: 8px;
  padding: 1.8rem 1.4rem 1.5rem;
  text-align: center;
  background: #fff;
}
.tile .tile-num {
  font-size: 3rem;
  font-weight: 500;
  color: #333;
  line-height: 1.1;
}
.tile .tile-label {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  margin-top: 0.6rem;
}

@media screen and (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
}

/* ---------------- results ---------------- */

.rank-scroll { overflow-x: auto; margin: 3rem 0 1rem; }

.rank-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  min-width: 680px;
}

.rank-cell {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 1.3rem 0.8rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.rank-cell.best { background: #FFF8EA; border-color: #F5B04E; }

.rank-bench {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
  min-height: 3.2rem;
}
.rank-num {
  font-size: 2.8rem;
  font-weight: 500;
  color: #333;
  margin: 0.4rem 0 0.2rem;
}
.rank-num sup { font-size: 1.3rem; color: #888; font-weight: 400; }

.rank-bar-box {
  margin-top: auto;
  height: 66px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.rank-bar {
  width: 26px;
  background: #F5B04E;
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
}

.table-scroll { overflow-x: auto; margin-top: 3.5rem; }
.table-scroll table { min-width: 560px; }
.table-scroll th { font-size: 1.35rem; }
.table-scroll td { font-size: 1.5rem; padding-right: 1.6rem; }
.table-scroll th { padding-right: 1.6rem; }
.row-aer td { background: #FFF8EA; font-weight: 500; }
td.num, th.num { text-align: right; padding-right: 0.4rem; }

.source-note {
  font-size: 1.3rem;
  color: #999;
  text-align: center !important;
  margin-top: 2rem;
}
.source-note a { color: #999; text-decoration: underline; }

/* ---------------- how it works ---------------- */

.phase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin: 2.5rem 0;
}
.phase-card {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 2rem;
  background: #fff;
}
.phase-card .phase-tag {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9A6E1B;
  margin-bottom: 0.8rem;
}
.phase-card h4 { font-size: 1.9rem; font-weight: 500; margin-bottom: 0.8rem; }
.phase-card p { font-size: 1.5rem; color: #555; margin-bottom: 0; }

@media screen and (max-width: 760px) {
  .phase-grid { grid-template-columns: 1fr; }
}

.fig { margin: 3rem 0; }
.fig img {
  width: 100%;
  height: auto;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  display: block;
  background: #fff;
}

.subhead {
  font-size: 2.2rem;
  font-weight: 500;
  margin: 5rem 0 1.2rem;
  text-align: center;
}

/* ---------------- optimizer steps ---------------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  max-width: 720px;
  margin: 3rem auto;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 2.2rem 5.6rem;
  font-size: 1.6rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.2rem;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: #FFF8EA;
  border: 1px solid #F5B04E;
  color: #9A6E1B;
  font-weight: 500;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.8rem;
  top: 3.6rem;
  bottom: 0.2rem;
  width: 1px;
  background: #ecdcb8;
}
.steps b { font-weight: 500; }
.steps .muted { color: #777; }

.inline-cta {
  text-align: center !important;
  font-size: 1.7rem;
  margin: 4rem 0 0;
}

/* ---------------- callout ---------------- */

.callout {
  border-left: 4px solid #d8d8d8;
  background: #f7f7f7;
  border-radius: 0 6px 6px 0;
  padding: 1.6rem 2rem;
  font-size: 1.5rem;
  color: #555;
  max-width: 760px;
  margin: 2.5rem auto;
}

/* ---------------- video ---------------- */

.video-box {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 880px;
  margin: 3rem auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  background: #000;
}
.video-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-facade {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  cursor: pointer;
}
.video-facade:hover, .video-facade:focus { background: #000; }
.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.88;
}
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  transition: background 150ms ease;
}
.play-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}
.video-facade:hover .play-btn, .video-facade:focus .play-btn { background: #c00; }

/* ---------------- form ---------------- */

.pilot-form { max-width: 720px; margin: 0 auto; text-align: left; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 2rem;
}
.form-field.full { grid-column: 1 / -1; }
@media screen and (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-field label {
  font-size: 1.35rem;
  font-weight: 500;
  color: #444;
  margin-bottom: 0.5rem;
}
.form-field label .opt { color: #999; font-weight: 400; }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: Roboto, sans-serif;
  font-size: 1.5rem;
  color: #333;
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 0;
}
.form-field textarea { min-height: 11rem; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #477dca;
  box-shadow: 0 0 0 3px rgba(71, 125, 202, 0.15);
}

.form-actions { margin-top: 2.4rem; text-align: center; }
.form-actions button {
  font-size: 1.6rem;
  border-radius: 5px;
  padding: 1.2rem 3.2rem;
  color: #fff;
}
.form-actions button:disabled { opacity: 0.6; }
.form-thanks {
  font-size: 1.8rem;
  text-align: center !important;
  color: #2c6e49;
  padding: 3rem 0;
}
.form-error {
  font-size: 1.4rem;
  color: #b3261e;
  text-align: center !important;
  margin-top: 1.4rem;
}
[hidden] { display: none !important; }

/* ---------------- footer ---------------- */

.footer-container { margin-top: 0; padding: 5rem 0 3rem; }
.footer-container p { margin-bottom: 0.6rem; }
